【发布时间】:2012-08-30 02:04:11
【问题描述】:
我正在尝试调用第三方 Web 服务,该服务在肥皂信封内寻找一个 xml 字符串。但是,当我传入一个 xml 字符串时,服务器会以 400 Bad Request 响应。如果我将 xml 排除在外,那么 Web 服务会正确返回一个错误,指出它需要该参数。我已经与 web 服务的开发人员进行了交谈,他们不确定为什么会发生这种情况。
这是我发送的 SOAP 信封,有问题的节点是 <web:xmlString>。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.example.com/">
<soapenv:Header/>
<soapenv:Body>
<web:AddWidget>
<web:Key>6F257576-2F95-4764-8539</web:Key>
<web:listID>62017</web:listID>
<web:Type>S</web:Type>
<web:format>HTML</web:format>
<web:xmlString><xml><Emails><Emailaddress>foo@bar.com</Emailaddress><User1>263885</User1></Emails></xml></web:xmlString>
<web:sfID>1536</web:sfID>
</web:AddWidget>
</soapenv:Body>
我尝试将 xml 字符串放在引号中、对其进行编码等,但没有运气。
【问题讨论】:
-
没有看到 Web 服务的 WSDL 和 XML 架构就无法回答
标签: xml web-services soap