axis2c
官网:http://axis.apache.org/axis2/c/core/index.html
设置AXIS2C_HOME路径:
export AXIS2C_HOME=xxx
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$AXIS2C_HOME/lib
设置wsdl2c.sh路径:
export AXIS2_HOME=xxx
export PATH=$PATH:/opt/eucalyptus/packages/axis2c-1.6.0/bin/tools/wsdl2c/
server端,生成so动态库:
gcc -olibhello.so -I$AXIS2C_HOME/include/axis2-1.6.0/ -L$AXIS2C_HOME/lib -laxutil -laxis2_axiom -laxis2_parser -laxis2_engine -lpthread -laxis2_http_sender -laxis2_http_receiver hello_svc.c -fPIC -shared
client端,生成执行文件:
gcc -o hello -I$AXIS2C_HOME/include/axis2-1.6.0/ -L$AXIS2C_HOME/lib -laxutil -laxis2_axiom -laxis2_parser -laxis2_engine -lpthread -laxis2_http_sender -laxis2_http_receiver hello.c -ldl -Wl,--rpath -Wl,$AXIS2C_HOME/lib
wsdl文件生成代码
server端:
sh WSDL2C.sh -uri Calculator.wsdl -sd -ss -d adb -u -f -o server
将生成的build.sh修改下:
gcc -g -fPIC -shared -olibCalculator.so -I $AXIS2C_HOME/include/axis2-1.6.0/ -Isrc -L$AXIS2C_HOME/lib -laxutil -laxis2_axiom -laxis2_engine -laxis2_parser -lpthread -laxis2_http_sender -laxis2_http_receiver -lguththila *.c
client端:
sh WSDL2C.sh -uri Calculator.wsdl -g -ss -d adb -u -f -o client
gcc -o cal_add -I$AXIS2C_HOME/include/axis2-1.6.0/ -L$AXIS2C_HOME/lib -laxutil -laxis2_axiom -laxis2_parser -laxis2_engine -lpthread -laxis2_http_sender -laxis2_http_receiver *.c -ldl -Wl,--rpath -Wl,$AXIS2C_HOME/lib