SOAP to REST API- JSON to XML with multiple namespace issue

Not applicable

I was trying to build REST API for soap backend service. SOAP WSDL has multiple namespaces , when apigee creates the policy to add namespaces after using JSON to XML policy its not able to map the namespaces for inner element. In the example below , APIGee is able to add the namespace for ns: but for the elements of com:

my intent is not to do 1-1 map of JSON request for SOAP payload instead would like to use the XSLT way of adding the namaspaces. any suggestions would would be appreciated.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns="http://webservices.amazon.com/AWSECommerceService/2011-08-01"
xmlns:com="http://www.aig.com/gct/services/commonHeaderV1.0">
<soapenv:Header/>
<soapenv:Body>
<ns:ItemSearch>
<ns:requestHeader>
<com:requestApplicationID>?</com:requestApplicationID>
<com:requestMessageID>?</com:requestMessageID>
</ns:requestHeader>
<ns:MarketplaceDomain>?</ns:MarketplaceDomain>
</ns:ItemSearch>
</soapenv:Body>
</soapenv:Envelope>

below is the apigee generated XSLT to add namespace.

<!-- If the root element is not what was in the schema, add it -->
<xsl:when test="not(normalize-space(/ItemSearch))">
<tns:ItemSearch>
<xsl:apply-templates select="node()|@*"/>
</tns:ItemSearch>
</xsl:when>

<xsl:template match="*[not(local-name()='Root') and not(local-name()='Array')]" name="copy-all">
<xsl:element name="tns:{local-name()}">
<xsl:copy-of select="namespace::*"/>
<xsl:apply-templates select="node()|@*"/>
</xsl:element>
</xsl:template>

0 2 7,147
2 REPLIES 2

Former Community Member
Not applicable

If the wsdl is publicly available, can you please post the link here?

sample.zip

Updated an sample AWS service with additional schema.