解决了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);
}
知识共享授权条款
本著作Chen, Zai-Chun制作,以知识共享 姓名标示-相同方式分享 4.0 国际 授权条款释出

留言