我想通过SOAP使用Web服务,并且阅读了关于在Mule网站上发现的“使用webservice”的所有文档。我正在使用此webservice进行测试:http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmxMule ESB - 请求格式无效的文本/ XML; charset = UTF-8
这是我的问题。
如果我使用WebServiceConsumer与DataMapper的,它发送
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns0:getMobileCodeInfo xmlns:ns0="http://WebXml.com.cn/">
<ns0:mobileCode>13683646566</ns0:mobileCode>
<ns0:userID/>
</ns0:getMobileCodeInfo>
</soap:Body></soap:Envelope>
和完美的作品。但重点是DataMapper不被Community Editon支持;所以我改用JAX-client。我的流程是
<sub-flow name="SOAP_test_Flow">
<set-payload value="#[{'13683646566',''}]" doc:name="Set Payload"/>
<cxf:jaxws-client operation="getMobileCodeInfo" clientClass="mobile.MobileCodeWS" port="MobileCodeWSSoap" wsdlLocation="classpath:/wsdl/MobileCodeWS.asmx.wsdl" doc:name="CXF"/>
<outbound-endpoint address="http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx/getMobileCodeInfo" encoding="UTF-8" mimeType="text/xml" doc:name="Generic"/>
</sub-flow>
其中通过/wsdl/MobileCodeWS.asmx.wsdl
生成的包mobile
。我非常确定我的流量是可以的,并且我已经测试了这个子流发送到
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getMobileCodeInfo xmlns="http://WebXml.com.cn/">
<mobileCode>13683646566</mobileCode>
<userID></userID>
</getMobileCodeInfo>
</soap:Body>
</soap:Envelope>
要瞄准的地址。但它返回
请求格式无效: text/xml; charset=UTF-8。
这意味着“请求格式无效:text/xml; charset = UTF-8”。
WSDL文件是在这里:http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl