| /* |
| * Copyright 2003-2004 The Apache Software Foundation. |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| * |
| * |
| * @author Damitha Kumarage (damitha@opensource.lk, damitha@jkcsworld.com) |
| * |
| */ |
| |
| |
| Introduction |
| ============ |
| |
| This guide will help you to start with Axis C++. I'll explain the minimum |
| steps needed to build and run Axis C++, and warn you about the common |
| pitfalls. |
| |
| What you need |
| ============= |
| RedHat 9(2.4.20-8) |
| expat-1.95.7(source) |
| xerces-c-src2_2_0(I build xerces from source) |
| httpd-2.0.48(source) |
| apache_1.3.27(source) |
| |
| Note: In my environment I have |
| autoconf 2.57, automake 1.6.3, libtool 1.4.3, gcc 3.2.2 |
| |
| I assume that you install as root user |
| |
| You can download the Axis C++ source or binary from one of the apache mirror sites |
| http://ws.apache.org/axis/cpp/download.html |
| |
| You can get expat from the uri http://sourceforge.net/projects/expat/ |
| |
| You can get xercesc from the uri http://www.xml.apache.org/xerces-c/download.cgi |
| |
| You must define some environment variables in order to build. |
| AXISCPP_HOME is where you checkout Axis C++ |
| |
| ------------------------------------------------------------ |
| AXISCPP_HOME="/usr/local/axiscpp" |
| AXISCPP_DEPLOY="/usr/local/axiscpp_deploy" |
| #apche2 home is only needed if you build for apache2 |
| APACHE2_HOME="/usr/local/apache2" |
| #apache home is only needed if you build for apache |
| APACHE_HOME="/usr/local/apache" |
| #expat home is needed if you use expat parser |
| EXPAT_HOME="/usr/local/expat1957" |
| #xercesc home is needed if you use xercesc parser |
| XERCESC_HOME="/usr/local/xerces-c" |
| LD_LIBRARY_PATH="$XERCESC_HOME/lib:$EXPAT_HOME/lib:$AXISCPP_DEPLOY/bin:$AXISCPP_DEPLOY/lib:$LD_LIBRARY_PATH" |
| export AXISCPP_HOME AXISCPP_DEPLOY XERCESC_HOME EXPAT_HOME APACHE2_HOME APACHE_HOME LD_LIBRARY_PATH |
| ------------------------------------------------------------ |
| |
| A note about AXISCPP_DEPLOY |
| When you buid you can give the configure option 'prefix' to point to the place |
| where you need axis c++ installed as, |
| configure --prefix=$AXISCPP_DEPLOY |
| |
| Give read write permissions to /usr/local/axiscpp_deploy |
| |
| EXPAT_HOME points to where you installed expat |
| XERCESC_HOME points to where you installed xereces-c |
| |
| Axis C++ core is independant of the parser layer and transport layer. |
| You can write your own transport or parser library according to the APIs provided. Currently Axis C++ |
| provides API implementations for Xerces-c and Expat. It also provides it's own client side transport |
| library implementation. In the server side deployment, Axis C++ provides two modules that can be loaded |
| into apache1.3 and apache 2 as shared libraries. |
| So this sums upto two posibilities. |
| You can deploy Axis C++ server |
| on Apache2 with xercesc parser or expat parser(Only one parser at a time) |
| on Apache1.3 with xercesc parer or expat parser |
| |
| So if you use only Expat no need to define XERCESC_HOME vice versa. |
| |
| When you build Axis C++ you can give options |
| 1) Build for Apache2 |
| with Expat parser support only |
| with Xerces paresr support only |
| with both parser support |
| 2) Build for Apache1.3 |
| with Expat parser support only |
| with Xerces parser support only |
| with both parser support |
| |
| You can choose these selections on when you configure as, |
| |
| ./configure --prefix=$AXISCPP_DEPLOY \ |
| --libdir=$AXISCPP_DEPLOY/lib \ |
| --bindir=$AXISCPP_DEPLOY/bin \ |
| --enable-apache2=yes \ |
| --enable-apache=no \ |
| --enable-expat=yes \ |
| --enable-xercesc=no \ |
| --enable-samples=yes \ |
| --enable-testcases=yes |
| |
| Following are the explanation of these options |
| |
| --libdir : Where libraries are installed. All Axis C++ libraries, sample libraries and testcase service |
| libraries are installed here |
| --bindir : All the client sample binaries are installed here |
| |
| --enable-apache2 : To use apache2 as server transport library |
| |
| --enable-apache : To use apache as server transport library |
| |
| --enable-expat : To build expat parser library |
| |
| --enable-xercesc : To build xercesc parser library |
| |
| --enable-samples : Whether you need to build samples(server and client) |
| |
| --enable-testcases : Wthether you need to build testcases |
| |
| Then I can build Axis C++ server, client,parser libraries, transport library and server/client samples |
| by, |
| cd $AXISCPP_HOME |
| sh build.sh |
| |
| Once you finished, have a look at $AXISCPP_HOME/build_errors. Most probably you will see many warnings. |
| Just ignore them. But if you see any errors it means that build was |
| not successful and check whether you followed the instructions |
| carefully. |
| |
| You can see the folder $AXISCPP_DEPLOY/lib to see what are created |
| |
| libaxiscpp_mod.so is apache module which is loaded when apache loads |
| libaxiscpp_mod2.so is apache2 module which is loaded when apache2 loads |
| libserver_engine.so is the Axis C++ server engine which is loaded by libaxis_mod(2).so module |
| libaxiscpp_client.so is Axis C++ client library |
| libaxis_transport.so is the Axis C++ client transport library |
| libaxis_expat.so is the expat parser library implementation for Axis C++ |
| libaxis_xercesc.so is the xercesc parser library implmentation for Axis C++ |
| |
| Also $AXISCPP_HOME/sampels/server samples are built and installed in |
| $AXISCPP_DEPLOY/lib |
| |
| $AXISCPP_HOME/samples/client samples are built and executable are in $AXISCPP_DEPLOY/bin |
| |
| Now you need to add to $<apache install directory>/conf/httpd.conf |
| $ vi <apache install directory>/conf/httpd.conf |
| |
| At the bottom of the file you have to include following lines and save it. |
| ------------------------------------------------- |
| LoadModule axis_module modules/libaxiscpp_mod2.so (in apache1.3 replace modules with libexec and libaxiscpp_mod2.so with libaxiscpp_mod.so) |
| |
| <Location /axis> |
| |
| SetHandler axis |
| |
| </Location> |
| --------------------------------------------------- |
| |
| Now you need the deployment descripter(server.wsdd) to deploy server samples you built. |
| By default there is a deployment descripter in $AXISCPP_DEPLOY/conf to |
| deploy samples |
| |
| In $AXISCPP_DEPLOY/axiscpp.conf file you can give paths to |
| your log files, configuration files libraries etc. |
| ------------------------------------------------------------------------------------------ |
| # The comment character is '#' |
| #Available directives are as follows |
| #(Some of these directives may not be implemented yet) |
| # |
| #WSDDFilePath:The path to the server wsdd |
| #LogPath:The path to the axis log |
| #ClientLogPath:The path to the axis client log |
| #ClientWSDDFilePath:The path to the client wsdd |
| #Transport_http:The HTTP transport library |
| #Transport_smtp:The SMTP transport library |
| #XMLParser:The xml parser library |
| |
| LogPath:/usr/local/axiscpp_deploy/log/AxisLog |
| WSDDFilePath:/usr/local/axiscpp_deploy/conf/server.wsdd |
| ClientLogPath:/usr/local/axiscpp_deploy/log/AxisClientLog |
| XMLParser:/usr/local/axiscpp_deploy/lib/libaxis_xmlparser.so |
| Transport_http:/usr/local/axiscpp_deploy/lib/libaxis_transport.so |
| |
| ----------------------------------------------------------------------------------------- |
| Now we need to copy apache module(libaxiscpp_mod2.so for apache2 and libaxiscpp_mod.so for apache) |
| to the correct places and start apache. To |
| do that you can find scripts written in $AXISCPP_DEPLOY. |
| cd $AXISCPP_DEPLOY |
| |
| To deploy on apache2 |
| sh deploy_apache2.sh |
| |
| To deploy on apache |
| sh deploy_apache.sh |
| |
| When you run the above script, |
| libaxiscpp_mod2.so is copied to <your apache home>/modules folder. |
| libaxis_expat.so is renamed to libaxis_xmlparser.so. Also apache is started and libaxiscpp_mod2.so is loaded into apache. |
| libaxiscpp_mod2.so is the apache module for Axis C++. This will in term load Axis C++ server engine |
| (libserver_engine.so). |
| Note that libaxis_xmlparser.so is loaded by the engine dynamically as parsing is required from the |
| engine. |
| |
| Note that somewhere in the script above it change |
| the name libaxis_expat.so to libaxis_xmlparser.so. |
| If we use xerces we need to change |
| libaxis_xercesc.so to libaxis_xmlparser.so. |
| |
| If you have done installation successfully it will display the Axis C++ welcome page when you point to URI http://localhost/axis . |
| Note: In the axis welcome page all the services in $AXISCPP_DEPLOY/conf/server.wsdd are listed. This does not mean |
| that the libraries corresponding to these services are deployed yet. It merely list whatever in the server.wsdd. |
| |
| To run interop samples |
| cd $AXISCPP_DEPLOY/bin |
| ./base localhost 80 etc. |
| |