【发布时间】:2018-01-11 20:28:59
【问题描述】:
这是我的 .net 代码生成的 xml 的 sn-p,发送到第三方肥皂服务端点。
<?xml version="1.0" encoding="utf-16"?>
<ProgramInterface
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<vnsState_request xmlns="http://www.statewide.Request.com">
.....
....
...
这通过代码工作,但是当我提出与我在 SoapUI 中的调试断点中提取的完全相同的请求并将其发送到相同的服务时,它返回 XML 格式错误的错误,如下所示
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>Malformed SOAP message</faultstring>
当我为同一操作生成示例请求时,我在生成的请求 XML 中看到了这种差异
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:vns="http://www.statewide.Request.com">
<soapenv:Header/>
<soapenv:Body>
<vns:VNSSTATEOperation>
<vns:vnsState_request>
为什么 SoapUI 需要这些额外的标签,为什么它不能使用我的 .Net 代码生成的请求?为什么它需要vns: 预先添加到每个元素以及这些新元素?
<soapenv:Envelope >
<soapenv:Header/>
<soapenv:Body>
【问题讨论】:
标签: xml wcf soap soapui xml-namespaces