gsoap之soap版本不匹配 .

来源:互联网 发布:算法小时代pdf 编辑:程序博客网 时间:2024/05/07 02:27

问题背景:

WCF server with basicHttpBinding use soap1.1, while gSoap generates client that uses soap1.2.

所以WCF server 和 gSoap产生的 client端之间通讯的soap message format不匹配。当客户端发起请求时,server端无法识别请求。

 

解决办法:

gSoap 生成的代码中,删除所有的soap1.2 namespace,换上对应的saop 1.1 namespace.

对于所有的gSoap工具生成的*Proxy.cpp 文件和*.nsmp文件,都要按如下格式将其中的soap 1.2 namespace 换成 soap 1.1 namespace.

 

{"SOAP-ENV", "http://www.w3.org/2003/05/soap-envelope", "http://schemas.xmlsoap.org/soap/envelope/", NULL},

{"SOAP-ENC", "http://www.w3.org/2003/05/soap-encoding", "http://schemas.xmlsoap.org/soap/encoding/", NULL},

{"xsi", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/*/XMLSchema-instance", NULL},

{"xsd", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/*/XMLSchema", NULL},

 

替换为:

 

{"SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/", NULL, NULL},

{"SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/", NULL, NULL},

{"xsi", "http://www.w3.org/2001/XMLSchema-instance", NULL, NULL},

{"xsd", "http://www.w3.org/2001/XMLSchema", NULL, NULL},

0 0
原创粉丝点击