发送soap报文得到soap:VersionMismatch的错误
时间:2010-09-14
来源:互联网
我是用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的冲突,我也按网上提供的方法做了,但是还没有解决。
用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的冲突,我也按网上提供的方法做了,但是还没有解决。
作者: zzd6436643 发布时间: 2010-09-14
你发送的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包有什么变化。
你用SOAP1.2的格式进行封装就没问题了。格式你可以参考这里:http://wenku.baidu.com/view/41034b35eefdc8d376ee3223.html
基本能满足,但这里不是最新的。如果想用最新的格式,可以阅读这里的规范http://www.w3.org/TR/2007/REC-soap12-part1-20070427/#soapenv
至于你说按网上的方法做了,我不知道你做了什么,至少从你贴出来的,仍没体现出你的SOAP包有什么变化。
作者: cds27 发布时间: 2010-09-15
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28