【发布时间】:2022-12-17 17:53:48
【问题描述】:
我使用返回 JSON 对象的 WSO2 数据服务创建了一个 API,我的客户端应用程序等待 SOAP 响应而不是 json 响应,所以我尝试使用数据映射器将响应格式从 JSON 更改为 SOAP,但它只返回 XML 格式没有 SOAP Body 和 SOAP 信封。如何解决这个问题?
这是我想要获得的 SOAP 响应格式:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetFacturesClientResponse xmlns="http://tempuri.org/">
<GetFacturesClientResult>
<code>0</code>
<codeClient>P-2008-043681</codeClient>
<nom>na</nom>
<prenom>ouss</prenom>
</GetFacturesClientResult>
</GetFacturesClientResponse>
</soap:Body>
</soap:Envelope>
但我得到了这样的回应:
<GetFacturesClientResponse xmlns="http://tempuri.org/">
<GetFacturesClientResult>
<code>0</code>
<codeClient>P-2008-043681</codeClient>
<nom>na</nom>
<prenom>ouss</prenom>
</GetFacturesClientResult>
</GetFacturesClientResponse>
这是我的代码:
<datamapper config="gov:datamapper/oussama.dmc" inputSchema="gov:datamapper/oussama_inputSchema.json" inputType="JSON" outputSchema="gov:datamapper/oussama_outputSchema.json" outputType="JSON" xsltStyleSheet="gov:datamapper/oussama_xsltStyleSheet.xml"/>
【问题讨论】:
标签: soap wso2 wso2-esb wso2-enterprise-integrator wso2-data-services-server