如何使用WSO2 ESB将传入的SOAP响应转换为JSON文档

如何使用WSO2 ESB将传入的SOAP响应转换为JSON文档,esb,Esb,我想使用ESB4.10将json转换为xml。并且需要知道并了解JBossESB如何支持JSON http请求?如果必须使用HTTP请求执行此操作,请共享一些我可以用来实现此操作的线程。在代理或REST API元素中,如果您愿意将给定响应(SOAP)转换回JSON,只需在输出序列中包含以下属性即可: <xslt key="ns-remove"/> <property name="messageType" value="application/json" scope="ax

我想使用ESB4.10将json转换为xml。并且需要知道并了解JBossESB如何支持JSON http请求?如果必须使用HTTP请求执行此操作,请共享一些我可以用来实现此操作的线程。

在代理或REST API元素中,如果您愿意将给定响应(SOAP)转换回JSON,只需在输出序列中包含以下属性即可:

<xslt key="ns-remove"/>   
<property name="messageType" value="application/json" scope="axis2"/>


将此部分包括在注册表中,通常我们需要删除所有可用的名称空间。

<localEntry key="ns-remove">
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
        <xsl:output method="xml"/>
        <xsl:template match="*">
            <xsl:element name="{local-name()}">
                <xsl:apply-templates select="@*"/>
                <xsl:apply-templates select="node()"/>
            </xsl:element>
        </xsl:template>
        <xsl:template match="@*">
            <xsl:attribute name="{local-name()}">
                <xsl:value-of select="."/>
            </xsl:attribute>
        </xsl:template>
        <xsl:template match="/">
            <xsl:copy>
                <xsl:apply-templates/>
            </xsl:copy>
        </xsl:template>
        <xsl:template match="comment() | processing-instruction() | text()">
            <xsl:copy/>
        </xsl:template>
    </xsl:stylesheet>
</localEntry>