在使用gsoap调用wcf发布的webservice时,总是提示415错误,查找错误半天发现,
gsoap使用的是soap2.0,而wcf发布的webservice使用的是soap1.0,所以想解决问题就是
需要将两边使用的soap对等。
解决方法:
将文件.namap和*Proxy.cpp文件中的
{"SOAP-ENV", "http://www.w3.org/2003/05/soap-envelope", "http://www.w3.org/2003/05/soap-envelope", NULL},
{"SOAP-ENC", "http://www.w3.org/2003/05/soap-encoding", "http://www.w3.org/2003/05/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},