on 03-25-2016 2:36 PM
Hi,
I know that it is possible to modify XML namespace and prefix in a SOAP receiver channel using XMLAnonymizerBean module.
But how can I handle this in a synchronous scenario, having a SOAP sender channel with QoS "BE"?
I already tried this two solutions:
- using XMLAnonymizerBean in SOAP sender channel doesn't affect the response payload;
- using an XSLT mapping on the response section of my operation mapping leads to an error
Thanks, regards.
Hello Matteo,
XSLT mapping should be good.
what is the error being thrown?.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, with my XSLT I modify both namespace and prefix.
Let's say I want to replace the standard "ns1" with the value "xyz". When the OM is executed, it throws an error like "ns1 namespace not found".
The XSLT is something like this:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xyz="http://www.xxxxxxxxx.com/xxx">
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/*">
<xsl:element name="xyz:{local-name()}">
<xsl:apply-templates select="@* | node()" />
</xsl:element>
</xsl:template>
<xsl:template match="*/*">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="@* | node()" />
</xsl:element>
</xsl:template>
</xsl:stylesheet>
(I also tried with "ns1" instead of "xyz")
Thanks.
Hello,
Try refering the below discussion and try the code in those links.
http://stackoverflow.com/questions/13974473/changing-the-namespace-with-xslt-1
Hi Matteo,
Use below XSLT:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns1="http://www.myCompany.com/xxx" xmlns:xyz="http://www.myCompany.com/yyy">
<xsl:output encoding="utf-8"/>
<xsl:template match="ns1:*">
<xsl:element name="xyz:{local-name()}" namespace="http://www.myCompany.com/yyy">
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Regards,
Praveen.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.