gsoap 生成客户端C程序怎么使用CDATA区段
1个回答
2017-09-11
展开全部
c++gsoap调用webservice的方法步骤:生成存客户端存根程序和框架wsdl2h-oxxx.hxxx.wsdl(-tD:/gsoap-2.7/gsoap/typemap.dat)soapcpp2-L-x-ixxx.h(-ID:/gsoap-2.7/gsoap/import)或直接自己编写xxx.h,并生成xxx.wsdl//gsoapnsservicename:xxx//gsoapnsservicestyle:rpc//gsoapnsserviceencoding:literal//gsoapnsservicelocation:ht//localhost:8080//gsoapnsschemanamespace:ht/localhost:8080/xxx.wsdlintns__add(inta,intb,int*result);客户端1)把如下生成的文件添加到项目:stdsoap2.h,stdsoap2.cpp,soapH.h,soapC.cpp,soapStub.h,soapxxxProxy.h,soapxxxProxy.cpp,xxxSoap.nsmapwsock32.lib2)代理方式调用#include"soapTestWebServiceProxy.h"#include"TestWebService.nsmap"intmain(intargc,char*argv[]){intresult=0;TestWebServiceProxyproxy;proxy.add(12,23,&result);}//w服务端1)把如下生成的文件添加到项目:stdsoap2.h,stdsoap2.cpp,soapH.h,soapC.cpp,soapStub.h,soapxxxService.h,soapxxxService.cpp,xxxSoap.nsmapwsock32.lib2)实现接口函数intTestWebServiceService::add(inta,intb,int*result){*result=a+b;returnSOAP_OK;}/3)开启服务#include"soapTestWebServiceService.h"#include"TestWebService.nsmap"intmain(intargc,char*argv[]){TestWebServiceServiceservice;service.run(8080);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询