我正在探索WSO2 ESB并遇到问题。我正在使用一个简单的通过代理来发布SAP(或邮差,测试)的XML数据,然后将其转发到REST API - 应该很容易!WSO2 ESB - 自动添加的肥皂信封导致问题
发帖时直接向REST API(不通过ESB),它工作正常。(200,OK)
但是WSO2 ESB被自动添加一个SOAP信封,里面的REST API不会接受。我试过各种方法来删除自动添加的SOAP信封,但没有成功。尝试XSLT转换,POX格式,丰富中介等,我可以找到每一个建议。 (如果它作为身体的一部分被发送我可以删除使用XSLT包络元件,但不是一个WSO2增加在)
我可以访问体,没有SOAP信封,使用:
<property name="body" expression="$body/*[1]" type="OM"/>
但不知道如何将其转发给API。
任何想法如何阻止WSO2 ESB中首先添加的信封,或者如何删除它?
我使用了this答案的xslt代码,当我将SOAP标签包含在主体中时它可以正常工作,但对似乎在WSO2中自动添加的SOAP信封没有影响(除了给出错误, )。
我试图线的不同变体:
<xsl:apply-templates select="soap:Envelope/soap:Body/*"/>
如
<xsl:apply-templates select="soap:Envelope/*"/>
<xsl:apply-templates select="/*"/>
这是一个错误我在ESB日志中看到:
无法使用以执行XSLT转换:Value {name ='null',keyValue ='discountPayment'}对源XPath:s11:Body/child :: [position()= 1] | S12:身体/子:: [位置()= 1]原因:无法使用XSLT结果创建的OMElement
我非常新的WSO2 ESB,以前没有使用XSLT,所以可能会出现一些非常在我的方法基本的错误....
这里是我的代理XML和XSLT的 “removeSOAP”:
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="APIServer" startOnLoad="true" trace="disable"
transports="https http" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<log level="full">
<property name="FirstLog" value="APITest LOG...."/>
<property name="payload" expression="$body/*[1]" type="OM"/>
</log>
<xslt key="removeSOAP"/>
<log level="full">
<property name="SecondLog" value="after xslt...."/>
</log>
<property name="messageType" scope="axis2" type="STRING" value="application/xml"/>
<send>
<endpoint name="endpoint_urn_uuid_xxxxxx">
<address trace="disable" uri="http://myAPIendpoint " />
</endpoint>
</send>
</inSequence>
<outSequence>
<log level="full"/>
<send/>
</outSequence>
<faultSequence/>
</target>
</proxy>
<?xml version="1.0" encoding="UTF-8"?>
<localEntry key="removeSOAP" xmlns="http://ws.apache.org/ns/synapse">
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:m="http://www.example.org/stock">
<xsl:template match="/">
<xsl:apply-templates select="soap:Envelope/soap:Body/*"/>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
</localEntry>
请添加您已经尝试对这个问题的代码。考虑阅读此:http://stackoverflow.com/help/how-to-ask – Aaron
你可以发布你正在使用的交易,包括头和你的代理服务配置? – jchaplin
添加您的esb代理配置xml ... –