先要准备好
Xerces C++ (2.2.0) XML parser
Apache ANT
Available from http://ant.apache.org
These scripts have been developed and tested using version 1.6.x
Java SDK – required for running of ANT scripts, and the compilation of WSDL2Ws tool
Require version 1.4+
Ant-Contrib – provide numerous extensions to ANT, including the compilation of C/C++.
Available from http://ant-contrib.sourceforge.net
Place JARs into [ANT INSTALL DIR]/lib.
Require both ant-contrib (v0.6) and cpptasks (v1.0beta3)
Doxygen – Used for generating API documentation
Available from http://www.doxygen.org
Compiler / Linker
gcc 2.95.3
以上软件的安装都比较简单,在axis文档中都描述,不多说了
以下是在编译axis之前必须设置的一些环境变量
#axis source的解压目录
export AXISCPP_HOME=/usr/local/src/axis-c-1.5.0-linux-src/
#axis binary 安装目录
export AXISCPP_DEPLOY=/usr/obj
export LD_LIBRARY_PATH=/usr/local/xerces/lib:$AXISCPP_DEPLOY/bin:$LD_LIBRARY_PATH
export ANT_HOME =/usr/local/ant/
export JAVA_HOME=/usr/local/java/
export XERCES_HOME=/usr/local/xerces/
export APACHE2_HOME=/usr/local/apache/
export AXISJAVA_LIB=/usr/local/src/axis-c-1.5.0-linux-src/lib/axisjava/
export AXIS_JARS_HOME=”$AXISCPP_HOME/lib/axisjava”
export AXIS_JARS=”$AXIS_JARS_HOME/axis-ant.jar:$AXIS_JARS_HOME/axis.jar:$AXIS_JARS_HOME/commons-discovery.jar:$AXIS_JARS_HOME/commons-logging.jar:$AXIS_JARS_HOME/jaxrpc.jar:$AXIS_JARS_HOME/log4j-1.2.4.jar:$AXIS_JARS_HOME/saaj.jar:$AXIS_JARS_HOME/wsdl4j.jar”
export CLASSPATH=”$CLASSPATH:./:$JAVA_HOME/lib:$AXIS_JARS:”
#以下是一些需要调整的编译选项,如果没有使用apache 1.3,就需要将apache13设置为false
Vi build/build.Linux.properties
server.apache13 = false
server.apache20 = true
#以下是编译失败的文件,需要做一些修改
src/transport/SOAPTransport.h
src/soap/xsd/IAnySimpleType.hpp
src/soap/xsd/DateTime.cpp
src/soap/xsd/Base64Binary.cpp
src/soap/xsd/NOTATION.cpp
src/wsdd/WSDDHandler.h
#以上文件需要添加 #include
#以下文件需要 change static_cast to (AXIS_PROTOCOL_TYPE)
src/cbindings/client/StubC.cpp
[cc] /usr/local/src/axis-c-1.5.0-linux-src/src/cbindings/client/StubC.cpp:41: static_cast from `AXISC_PROTOCOL_TYPE’ to `axiscpp::AXIS_PROTOCOL_TYPE’
[cc] /usr/local/src/axis-c-1.5.0-linux-src/src/cbindings/client/StubC.cpp: In function `void axiscSetTransportProtocol(void *, AXISC_PROTOCOL_TYPE)’:
[cc] /usr/local/src/axis-c-1.5.0-linux-src/src/cbindings/client/StubC.cpp:158: static_cast from `AXISC_PROTOCOL_TYPE’ to `axiscpp::AXIS_PROTOCOL_TYPE’
————————–>