在Ubuntu上配置的操作步骤:
1. 检查apache是否至此后mod_so模块: $ apache2ctl -l 结果显示应包含:
Compiled in modules:
2. 编译 mod_gsoap: sudo apxs -a -i -c mod_gsoap.c
sudo cp apache_gsoap.h /usr/include/apache2/
3. 编译测试样本
luo@acs:~/gsoap-2.8/gsoap/samples$ cp -R calc calc_server
luo@acs:~/gsoap-2.8/gsoap/samples$ cd calc_server/
vi calcserver.c
#include "apache_gsoap.h"
$ll drwxr-xr-x 2 luo root 4096 Apr 12 14:28 .libs/ luo@acs:~/gsoap-2.8/gsoap/samples/calc_server$ cd .libs/
luo@acs:~/gsoap-2.8/gsoap/samples/calc_server/.libs$ pwd
luo@acs:~/gsoap-2.8/gsoap/samples/calc_server/.libs $ ll -rwxr-xr-x 1 luo root 280667 Apr 12 14:28 calcserver.so*
4.编辑 httpd.conf文件 $sudo vi /etc/apache/httpd.conf
<IfModule mod_gsoap.c>
5. 重启apache服务器 luo@acs:~$ sudo /etc/init.d/apache2 restart
6. 编译测试的客户端 luo@acs:~/gsoap-2.8/gsoap/samples/calc_server$ gcc -o calcclient calcclient.c soapC.c soapClient.c stdsoap2.c
7. 测试
luo@acs:~/gsoap-2.8/gsoap/samples/calc_server$ ./calcclient add 1 2
OK! (责任编辑:IT) |