Hello @Suraj Yedre
My apologies for the late reply. In case this is still an issue for you or anyone else revisiting this post, here's how I made it work. For this type of transformation, APIM offers the <xsl-transform>
policy which is documented here: Transform XML using an XSLT
Since you wanted to transform the <a:order_id>
node into <a:neworder_id>
node in the output of the response, you can add the following XSLT into the <outbound>
section of your policy snippets:
<xsl-transform>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://schemas.datacontract.org/2004/07/FazioAPISoap">
<xsl:output omit-xml-declaration="yes" method="xml" indent="yes" />
<xsl:template match="//a:order_id">
<a:neworder_id>
<xsl:apply-templates select="@*|node()" />
</a:neworder_id>
</xsl:template>
<!-- Template to match all nodes, copy them and then apply templates to children. -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
</xsl-transform>
When I test the above, I'm able to get the following payload where the intended transformation has successfully occurred:
I hope this is helpful, please let me know if any questions on this matter, and I'd be happy to assist.