gSOAP下载:https://www.genivia.com/downloads.html
编译安装:请自行查看源码包里的 INSTALL.txt
(一)Getting Started with gSOAP 之 Hello world: getting started with SOAP APIs
- 创建 hello.h ,代码如下:
// hello.h
int ns__hello(std::string name, std::string& greeting);
- 通过gSOAP自动生成相关代码,生成方法如下:
soapcpp2 hello.h
soapcpp2 在 源码目录的 gsoap/src/ 目录下。
执行后生成文件如下:
- 创建 hello.cpp,代码如下:
// hello.cpp
#include "soapH.h" // include the generated source code headers
#include "ns.nsmap" // include XML namespaces
int main()
{
return soap_serve(soap_new()