# WSO2 Web Services Framework for C++ - Installation Guide (Linux)

## 1. Software Dependencies

### 1.1. Mandatory

- OpenSSL - http://www.openssl.org/ - Required for SSL client transport and WS-Security with Apache Rampart/C

### 1.2. Optional

- Libxml2 - http://www.xmlsoft.org/
- libiconv - http://www.gnu.org/software/libiconv/
- zlib - http://www.zlib.net/
- Apache2 httpd - http://httpd.apache.org/ - Required for deploying services with HTTPD
- Either SQLite - http://www.sqlite.org/ or MySQL - http://www.mysql.org/ - Required for WS-ReliableMessaging with Apache Sandesha2/C
- iksemel - http://iksemel.jabberstudio.org/ - Required for XMPP transport

## 2. Requirements

To install and run WSF/C++ using the source distribution on Linux, you are required to have pkg-config on your system. By default, most Linux systems have this tool.

## 3. Building and Installing WSO2 WSF/C++ from Source on Linux.

1. Extract the source tar package to a folder.
2. Set WSFCPP_HOME environment variable pointing to the location where you want to install WSO2 WSF/C++.

       	$ WSFCPP_HOME='/your_desired_path_to_wsf_c++_installation'
       	$ export WSFCPP_HOME

3. Then go to the folder where you extracted the source.

       	$ cd /your_path_to_wsf_c++_source

4. Build the source
   * This can be done using the following command sequence in the directory where you have extracted the source

       	$  ./configure --prefix=<Path to WSF/CPP installation location>
       	$ make
       	$ make install
       	$ make samples

5. Go to where you installed WSO2 WSF/C++. Start simple axis server
   * To start the simple axis server on port 9090 run the following commands

       	$ cd ${WSFCPP_HOME}/bin
       	$ ./axis2_http_server

   To see the possible command line options run `./axis2_http_server -h`. If you run into shared library problems, try setting the LD_LIBRARY_PATH

       	$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${WSFCPP_HOME}/lib

6. Build the codegeneration tool
   Inorder to build the codegeneration tool which is written in java,you will need to have the mavan2 installed. Get apache maven from apache mavan download site
   Use the script build_codegen.sh to build and install the tool to the proper location.
7. Usually, it will copy to the scripts to the default location which is `pwd'/deploy. However you can give your preferred WSF/CPP installation location ( Which was provided in configuring WSF/CPP ) as follows.

       sh copy_codegen.sh wso2-wsf-cpp

   It will copy the WSDL2CPP.sh and WSDL2CPP.bat files to $(WSFCPP_HOME)/bin/tools/codegen/wsdl2cpp directory.

Now you are ready to use WSO2 WSF/C++.
Notes:

- You may require super user privileges to run `make install` on your system.
- You may optionally specify the path in which the installation should be deployed using `./configure --prefix=PATH`.
- If you don't provide the `--prefix` configure option, WSO2 WSF/C++ will by default be installed into, `/opt/wso2/wsf_cpp`
- You may run `./configure --help` for more information on configure options.