发送soap报文得到soap:VersionMismatch的错误

zzd6436643 2010-09-14 10:59:12
我是用httpClient这个发送的soap报文,
用method.setRequestBody(s);这个方法去设置它post的内容,client.executeMethod(method);去执行。
其中s的内容是发送的soap报文 格式如下:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:callWebService soapenv:encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1=" http://webservice.bsn.ztesoft.com">
<requMessage href="#id0"/>
</ns1:callWebService>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle=" http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:RequMessage" xmlns:soapenc=" http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2=" http://model.webservice.bsn.ztesoft.com">
<srvModule xsi:type="xsd:string">BillItemCQSrv</srvModule><passwd xsi:type="xsd:string"/><srvFunction xsi:type="xsd:string">queryCustList</srvFunction><content xsi:type="xsd:string"><?xml version="1.0" encoding="UTF-8"?><BillItemCQReq><AccNbr>18983080008</AccNbr><NbrType>1</NbrType><DisPlayType>1</DisPlayType><BillingMonth>201004</BillingMonth><PageNo>1</PageNo><PageSize>2</PageSize></BillItemCQReq></content><connectId xsi:type="xsd:string">68409706</connectId>
</multiRef>
</soapenv:Body>
</soapenv:Envelope>
以下是得到的错误的报文:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<soapenv:Upgrade soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0">
<soapenv:SupportedEnvelope qname="soapenv:Envelope"/>
</soapenv:Upgrade>
</soapenv:Header>
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:VersionMismatch</faultcode>
<faultstring>Version Mismatch</faultstring>
<detail><ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">jfapp1_perm</ns1:hostname></detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
网上说是soap1.1和soap1.2的冲突,我也按网上提供的方法做了,但是还没有解决。
...全文
2325 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
cds27 2010-09-15
  • 打赏
  • 举报
回复
你发送的SOAP 1.1的版本,但服务器可能要求的是1.2,所以版本不匹配。
你用SOAP1.2的格式进行封装就没问题了。格式你可以参考这里:http://wenku.baidu.com/view/41034b35eefdc8d376ee3223.html
基本能满足,但这里不是最新的。如果想用最新的格式,可以阅读这里的规范http://www.w3.org/TR/2007/REC-soap12-part1-20070427/#soapenv

至于你说按网上的方法做了,我不知道你做了什么,至少从你贴出来的,仍没体现出你的SOAP包有什么变化。

8,906

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧