1、开发环境请参考《搭建ACE-5.7.4+VS2008开发环境》一文
2、gSOAP库,下载地址:http://gsoap2.sourceforge.net/,本文使用的版本是:gsoap_2.7.15,gSOAP的编程可以参考doc目录下的soapdoc2.pdf,官方文档写的非常详细。
让我们开始gSOAP编码旅程:
1、创建gsoap_server.h:
- //gsoap ns2 service namespace: http://localhost:9908/ccm_mimport/services.wsdl
- //gsoap ns2 service location: http://localhost:9908/ccm_mimport/services
- typedef char * xsd__string; // encode char * value as the xsd:string schema type
- int xsd__int; // encode xsd__int value as the xsd:int schema typ
- struct ns2__makeCardNotifyReqBean
- {
- xsd__string id_makecard_order;
- xsd__int card_type;
- xsd__string file_name;
- xsd__string start_card_serial;
- xsd__string end_card_serial;
- xsd__int card_count;
- };
- struct ns2__makeCardNotifyRspBean
- xsd__int result; //结果
- xsd__string error_desc; //错误描述
- //卡数据生成结果通知接口
- int ns2__makeCardNotify(struct ns2__makeCardNotifyReqBean req, struct ns2__makeCardNotifyRspBean *rsp);
注:头文件上面的注释用于配置服务访问地址,而非单纯的注释;详细配置说明可以参考官方文档
2、把%GSOAP_HOME%/gsoap/bin/win32目录配置到系统%Path%里,或者将目录下的soapcpp2.exe和wsdl2h.exe两个文件直接拷贝到gsoap_server.h所在目录;
3、编写批处理文件:
copy