使用的版本为2.7.12,据说2.7.14有些BUG
生成代码:
1.生成.h文件,因为要用到2个WebService,所以一定要这样拼接。
wsdl2h -o UCCService.hhttp://localhost:808/uccservice/services/TestService?wsdlhttp://192.168.1.111:801/webservice/services/UCCService?wsdl
因为我的项目是Unicode编码,所以,这个时候要把UCCService.h中的std::string全部替换给std::wstring
替换完毕后,就可以生成代理类,然后就很容易使用了。
soapcpp2 -CLwx -I ../../import UCCService.h
备注:如果不替换成std::wstring,网上盛传的在代理类中set_soap_mode(soap,方法也是可行的,但是每次要用前都要
MultiByte2WideChar(CP_UTF8,... 转换成UTF8编码。