分类:
2008-10-15 13:45:33
1、 软件选型
l AXIS2/C 据考证没有在AIX上成功部署的先例,主要原因是编译后其动态调用的类库。a,无法加载。
l gSOAP最新版,经过,其最新版2.7.11无法在AIX5.3下编译通过,主要原因是gSOAP2.7.11编译时使用的bison(GNU 2.3)、flex(2.5.4)类库与AIX上所能提供的bison(1.875)、flex(2.5.4)版本存在差异。AIX自带的yacc、lex也无法实现。
l gSOAP2.7.9d,经过,该版本做一定修改后即可部署成功。
修改内容:${GSOAP_HOME}/soapcpp2/src/soapcpp2_lex.l 794行的“// FIXME if (!lflag)”移除即可。
2、 环境配置(需要root权限,进行操作)
为了完成编译需要以下类库,IBM RPM从ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/:
l automake-1.8.5-1.aix5.1.noarch.rpm 或 automake-1.6.3.tar.gz
1) 如果采用IBM提供的RPM,则安装完后,需要ln /usr/bin/automake/bin/automake-1.8 /usr/bin/automake/bin/automake-1.6 和 ln /usr/bin/automake/bin/aclocal-1.8 /usr/bin/automake/bin/aclocal-1.6
2) 如果采用automake-1.6.3.tar.gz,安装完后需要chmod相应执行权限。
l autoconf-2.59-1.aix5.1.noarch.rpm
l bison-1.875-3.aix5.1.ppc.rpm
l flex-2.5.4a-6.aix4.3.ppc.rpm
l m4-1.4.1-1.aix5.1.ppc.rpm
安装方法:rpm –ivh *rpm
gSOAP编译部署方法:
。/configure –prefix=${GSOAP_HOME}
。/make
。/make install
3、 客户端编写
客户端编写需要服务wsdl描述文件。
代码产生步骤(产生C代码):
${GSOAP_HOME}/bin/wsdl2h –c *.wsdl
${GSOAP_HOME}/bin/soapcpp2 –c *.h
编写Client如下:
#include "soapH.h" #include "ServPWDServiceHttpBinding.nsmap" int main() { struct soap soap; struct _ns1__CheckServPWDResponse ret; struct _ns1__CheckServPWD seg={"0351","899","6067","123456"}; const char * endPoints = " ce"; soap_init(&soap); if (soap_call___ns1__CheckServPWD(&soap, endPoints, NULL, &seg, &ret) == SOAP_OK ) printf("%s\n", ret.out); else soap_print_fault(&soap, stderr); soap_destroy(&soap); soap_end(&soap); soap_done(&soap); return 0; } |
[1]