- download gsoap_2.8.33.zip https://sourceforge.net/projects/gsoap2/files/gSOAP/
Looking for the latest version? Download gSOAP 2.8.33 stable (24.1 MB) - unzip gsoap_2.8.33.zip // 解压gsoap_2.8.33.zip
- cd gsoap-2.8
编译生成 soapcpp2和wsdl2h这2个工具。
打开 INSTALL.sh
本机编译(参考35~44行):
To do so, use the command line to run ‘make’ with generic makefiles:$ cd gsoap/src $ make -f MakefileManual $ cd gsoap/wsdl $ make -f MakefileManual This builds 'soapcpp' with 'gcc' and 'wsdl2h' with 'g++' and installs the binaries in gsoap/bin. Move them to a bin directory or include them in your executalbe path.
交叉编译(参考51~56行):
To compile with a different compiler instead of GCC, for example ‘clang’, use:$ cd gsoap/src $ make CC=clang -f MakefileManual $ cd gsoap/wsdl $ make CC=clang CPP=clang++ -f MakefileManual secure 注:secure选项为HTTPS使能。 不需要HTTPS时不需要 secure 选项。
- 将gsoap/bin目录下的 soapcpp2和wsdl2h拷贝到$PATH目录下。
测试gsoap.(主机可以访问互联网)
$ cd gsoap/samples/calc $ cp ../../stdsoap2.c . $ cp ../../stdsoap2.h . $ soapcpp2 -c calc.h $ cc -o calcclient calcclient.c stdsoap2.c soapC.c soapClient.c
编译生成calcclient, 并执行
$ ./calcclient add 3 4
result = 7
测试成功。
gsoap使用示例
最新推荐文章于 2018-09-04 10:22:08 发布