概述
使用gsoap工具生成soap.h.cpp文件遇到的问题
if (soap_begin_recv(soap)
|| soap_envelope_begin_in(soap)
|| soap_recv_header(soap)
|| soap_body_begin_in(soap))
return soap_closesock(soap);
// 更改, 第三个参数不为空 . 这个soap_get 就会返回 soaperror = SOAP_FAULT的错误 (SOAP_MESSAGE(fdebug, "Received SOAP Fault code %sn", s));)
// 更改, 第三个参数不为空
ns1__GetXYResponse->soap_get(soap, "ns1:GetXYResponse", "ns1:GetXYResponse");
if (soap->error)
{ if (soap->error == SOAP_TAG_MISMATCH && soap->level == 2)
return soap_recv_fault(soap,0);
return soap_closesock(soap);
}
mssoaptool监控信息 内容
发送soap内容
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns3="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:ns4="http://schemas.datacontract.org/2004/07/PGis110.Helper" xmlns:ns1="http://tempuri.org/" xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:wsc="http://schemas.xmlsoap.org/ws/2005/02/sc" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust"><SOAP-ENV:Body><ns1:GetXY><ns1:phone>15131040117</ns1:phone></ns1:GetXY></SOAP-ENV:Body></SOAP-ENV:Envelope>
返回内容
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/fault</a:Action></s:Header><s:Body><s:Fault><s:Code><s:Value>s:Sender</s:Value><s:Subcode><s:Value>a:ActionMismatch</s:Value></s:Subcode></s:Code><s:Reason><s:Text xml:lang="zh-CN">The SOAP action specified on the message, '', does not match the HTTP SOAP Action, 'http://tempuri.org/IMobileService/GetXY'. </s:Text></s:Reason><s:Detail><a:ProblemHeaderQName>a:Action</a:ProblemHeaderQName></s:Detail></s:Fault></s:Body></s:Envelope>
主要是这个错误
The SOAP action specified on the message, '', does not match the HTTP SOAP Action, 'http://tempuri.org/IMobileService/GetXY'
查了下 “I think you have problem with SOAP version. Check out what SOAP version uses WCF and”
Ok problem solved. Changed binding to basicHttp and it worked with PHP.
这个webs是wcf 写的 使用的是soap 1.2协议发布的 , 而gsoap生成这堆cpp h时是按soap1.1生成的,
网上说的是 bind 的类型不一致导致的. webs 中使用的是 wsHttp 而c端使用的是 basicHttp
我猜.... 这个问题我没有找到解决防范, 由于项目时间紧我只好找其他
解决方法.......最后
以上就是能干钢笔为你收集整理的gsoap工具生成soap.h.cpp文件遇到的问题的全部内容,希望文章能够帮你解决gsoap工具生成soap.h.cpp文件遇到的问题所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复