【注意】最后更新于 February 28, 2012,文中内容可能已过时,请谨慎使用。
解决了Error 200之后又遇到了Error 500:
Error 500 fault: SOAP-ENV:Server[no subcode]
通过tcpdump分析得到,gsoap强制加入了一个SOAP-ENV:mustUnderstand=“1"属性,而web service方不能解析该属性。
解决办法,
1
2
| // set mustUnderstand to 0
soap.mustUnderstand=0;
|
修改soapC.cpp, 注释掉soap->mustUnderstand=1
这一行:
1
2
3
4
5
6
7
8
9
10
| SOAP_FMAC3 int SOAP_FMAC4 soap_out_SOAP_ENV__Header(struct soap *soap, const char *tag, int id, const struct SOAP_ENV__Header *a, const char *type)
{
(void)soap; (void)tag; (void)id; (void)type;
if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, a, SOAP_TYPE_SOAP_ENV__Header), type))
return soap->error;
//soap->mustUnderstand = 1;
if (soap_out_PointerTons1__AuthenticationInfo(soap, "ns1:AuthenticationInfo", -1, &a->ns1__AuthenticationInfo_, ""))
return soap->error;
return soap_element_end_out(soap, tag);
}
|