Axis2 Linux 下安装步骤说明

目录
软件说明

安装Apahce

安装Axis2

发布axis.so

编译Axis2 Sample

编译测试Axis2 hello demo

参考资料

备注 错误说明
软件说明

1. httpd-2.2.22.tar.gz

2. axis2c-src-1.6.0.tar.gz

安装Apahce
解压:tar zxvf httpd-2.2.22.tar.gz
cd httpd-2.2.22
配置:./configure --prefix=/apache/httpd #把HTTP服务安装到/apache/httpd目录下
编译:make
安装:make install
定制:编辑/apache/httpd/conf/httpd.conf中的ServerRoot值为”/apache/httpd”
去掉ServerName的注释,并设置值为 localhost:80
启动:/apache/httpd/bin/apachectl start
检验:使用浏览器打开网址 http://localhost 看是否出现Apache的欢迎页面。

修改位置如图所示:

clip_image001[4]

clip_image002[4]

 

安装Axis2

1. 设置环境变量

vim /etc/profile

到最后一行增加以下内容

 

AXISCPP_HOME=/apache/axis2c-src-1.6.0

AXIS2C_HOME=/apache/axiscpp

AXISCPP_DEPLOY=/apache/axiscpp

LD_LIBRARY_PATH=/usr/lib:$AXISCPP_DEPLOY/lib:$LD_LIBRARY_PATH

export AXIS2C_HOME AXISCPP_HOME AXISCPP_DEPLOY LD_LIBRARY_PATH

注销用户重新登录

2. 安装

解压:tar zxvf axis2c-src-1.6.0.tar.gz --directory=/apache
将axis c++源码解压到/apache/axis-c-src-1-3-linux目录下。
cd $AXISCPP_HOME
配置:./configure  --prefix=$AXISCPP_DEPLOY --with-apache2=/apache/httpd/include
编译:make    (需要几分钟时间)
安装:make install
检验:检查/apache/axiscpp目录下是否生成了Axis C++的目录。
发布axis.so
cp $AXIS2C_HOME/lib/libmod_axis2.so.0.6.0 /apache/httpd/modules/mod_axis2.so

vim /apache/httpd/conf/http.conf增加以下内容

LoadModule axis2_module modules/mod_axis2.so 
Axis2RepoPath /apache/axiscpp
Axis2LogFile /usr/tmp/AxisLog
Axis2MaxLogFileSize 200
Axis2LogLevel LOG_LEVEL
<Location /axis2>
    SetHandler axis2_module
</Location>

如图所示:

image

编译Axis2 Sample
cd /apache/axis2c-src-1.6.0/samples/
./configure --prefix=${AXIS2C_HOME} --with-axis2=${AXIS2C_HOME}/include/axis2-1.6.0
make 
m cannot set language to "en_us"ake install

 

编译测试Axis2 hello demo

 

//编译服务端
cd /apache/axiscpp/docs/docs/hello/service
gcc -shared -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
cp hello/services.html services.xml
mkdir /apache/axiscpp/services/hello
mv services.xml libhello.so /apache/axiscpp/services/hello

//编译客户端
cd /apache/axiscpp/docs/docs/hello/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

//测试
开启两个终端,一个运行服务端,一个运行客户端
服务端:
重启httpd
/apache/httpd/bin/apachectl stop
/apache/httpd/bin/apachectl start
/apache/axiscpp/bin/axis2_http_server
客户端:
cd /apache/axiscpp/docs/docs/hello/client
./hello
可以看到在服务端返回的信息
在服务端可以看到客户端发送的信息

如图所示:

客户端:

clip_image002

服务端:

clip_image003[4]

参考资料

http://axis.apache.org/axis2/c/core/docs/axis2c_manual.html

备注 错误说明

1. 运行客户端后没有提示内容,可以从log中看到错误信息

Vim /usr/tmp/AsixLog

124 [Wed Jun 20 19:06:31 2012] [error] class_loader.c(162) Loading shared library /apache/axiscpp/services/hello/libhello.so Failed. DLERROR IS /apache/axiscpp/services/hello/libhello.so: cannot restore segment prot after reloc: Permission denied

clip_image002[4]

这是因为SELINUX的问题,需要关闭SELINX,执行:/usr/sbin/setenforce 0

在重启apache服务,在运行服务端程序.运行客户端程序就可以看到内容

 

文档下载:

本文档下载

转载于:https://www.cnblogs.com/fjchenqian/archive/2012/08/05/2623601.html

最新版本的axis2c Apache Axis2/C What is it? ----------- The Apache Axis2/C is a SOAP engine implementation that can be used to provide and consume Web Services. Axis2/C is an effort to implement Axis2 architecture, in C. Please have a look at http://ws.apache.org/axis2/1_0/Axis2ArchitectureGuide.html for an overview on Axis2 architecture. Axis2/C supports both SOAP 1.1 and SOAP 1.2. The soap processing model is built on the AXIOM XML object model. Axis2/C is capable of handling one-way messaging (In-Only) as well as request response messaging (In-Out). It can be used in both synchronous and asynchronous modes. Axis2/C has built in WS-Addressing support. It implements WS-Addressing 1.0 specification completely. It also has built in MTOM/XOP support for handling binary attachments. As a project of the Apache Software Foundation, the developers aim to collaboratively develop and maintain a robust, commercial-grade, standards-based Web Services stack implementation with freely available source code. The Latest Version ------------------ Details of the latest version can be found on the Apache Axis2/C project page under http://ws.apache.org/axis2/c. Documentation ------------- The documentation available as of the date of this release is included in HTML format in the docs/ directory. The most up-to-date documentation can be found at http://ws.apache.org/axis2/c/docs/index.html. Installation ------------ Please see the file named INSTALL. You can also have a look at docs/installationguide.html. Licensing --------- Please see the file named LICENSE. Contacts -------- o If you want freely available support for using Apache Axis2/C please join the Apache Axis2/C user community by subscribing to users mailing list, axis-c-user@ws.apache.org' as described at http://ws.apache.org/axis2/c/mail-lists.html o If you have a bug report for Apache Axis2/C please go log a Jira issue at http://issues.apache.org/jira/browse/AXIS2C o If you want to participate in actively developing Apache Axis2/C please subscribe to the `axis-c-dev@ws.apache.org' mailing list as described at http://ws.apache.org/axis2/c/mail-lists.html Acknowledgements ---------------- Apache Axis2/C relies heavily on the use of autoconf and libtool to provide a build environment.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值