# WSO2 Web Services Framework for C - Installation Guide

## 1. Software Dependencies

### 1.1. Mandatory

- Libxml2 - http://www.xmlsoft.org/
- libiconv - http://www.gnu.org/software/libiconv/
- zlib - http://www.zlib.net/

### 1.2. Optional

- Apache2 httpd - http://httpd.apache.org/ - Required for deploying services with HTTPD
- OpenSSL - http://www.openssl.org/ - Required for SSL client transport and WS-Security with Apache Rampart/C
- iksemel - http://iksemel.jabberstudio.org/ - Required for XMPP transport

## 2. Installing and Running on Linux

### 2.1 Using the Source Release

Follow these steps 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.

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

               $ WSFCPP_HOME='/your_desired_path_to_wsfc_installation'
               $ export WSFCPP_HOME

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

               $ cd /your_path_to_wsfc_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=${WSFCPP_HOME}
               $ make
               $ make install
               $ make samples

   Use './configure --help' to find out the possible configuration options.
   Note: If you do not provide a --prefix configure option, by default it will be installed into /opt/wso2/wsf_c directory.

- Go to where you installed WSO2 WSF/C. Start the 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 Note: If you run into shared library problems, try setting the LD_LIBRARY_PATH

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

  Run the wsclient in a new shell.

              $ cd /your_path_to_wso2_wsfc/bin
              $ ./wsclient --soap http://localhost:9090/axis2/services/echo < samples/wsclient/data/echo.xml

  You can also run the sample shell scripts given for the wsclient.

              $ cd /your_path_to_wso2_wsfc/bin/samples/wsclient
              $ sh echo.sh

  To see the possible command line options, run ./wsclient --help or ./wsclient -h

### 2.2. Using the RPM Package

You can install the RPM package using the following command.

            $ rpm -i <wso2-wsf-c.rpm.file.name>

This will install WSO2 WSF/C to /opt/wso2/wsf_c/ Set the WSFCPP_HOME environment variable to that location.

            $ WSFCPP_HOME=/opt/wso2/wsf_c/
            $ export WSFCPP_HOME

To run and test the installation, you can follow step 5 in section 2.1. above.

### 2.3. Using the deb Package

You can install the deb package using the following command.

            $ dpkg -i <wso2-wsf-c.deb.file.name>

This will install WSO2 WSF/C to /opt/wso2/wsf_c/ Set the WSFCPP_HOME environment variable to that location.

            $ WSFCPP_HOME=/opt/wso2/wsf_c/
            $ export WSFCPP_HOME

To run and test the installation, you can follow step 5 in section 2.1. above.

## 3. Installing and Running on Microsoft Windows (Win32)

This can be done using either the binary or source distribution.

### 3. 1. Using the Binary Release

#### 3.1.1. Requirements

The binaries shipped with this version are compiled with Microsoft Visual Studio Compiler (cl)
(Note: You can download Microsoft VSExpress2005 edition from the Microsoft Web site and install it to run these binaries.)
You also need to have a look at and install the dependencies mentioned in section 1. above.

#### 3.1.2. Installing and Running the Binaries

1. Extract the binary distribution to a folder of your choice. (example: C:\wsfc)

- Copy libxml2.dll, iconv.dll and zlib1.dll downloaded to C:\wsfc\lib
  you need to set a couple of environment variables before you can run the server and wsclient.
  * Set the variable WSFCPP_HOME to the deploy folder (C:\wsfc)

                      > set WSFCPP_HOME=C:\wsfc

  * Add the path to the lib directory to the PATH variable (%WSFCPP_HOME%\lib)

                      > set PATH=%PATH%;%WSFCPP_HOME%\lib

  Now everything is set to run the server.

                      > axis2_http_server.exe

  If the server is running successfully, you should see the following message.
  "Started Simple Axis2 HTTP Server..."
  (Note: You may provide command line options to change the default behavior. Use the command "axis2_http_server.exe -h" to learn about the usage.)
  Run the wsclient in a new DOS shell.

          > cd c:\wsfc\bin
          > wsclient --soap http://localhost:9090/axis2/services/echo < samples/wsclient/data/echo.xml

  To see the possible command line options, run wsclient --help or wsclient -h
  You can also run the sample batch scripts given for wsclient.

          > cd c:\wsfc\bin\samples\wsclient
          > echo.bat

### 3.2 Using the Source Release

#### 3.2.1. Requirements

The makefile shipped with this version needs Microsoft Visual Studio Compiler (cl) and the nmake build tool.
(Note: You can download the Microsoft VSExpress2005 edition and the Platform SDK from the Microsoft Web site. You will need to add the path to the Platform SDK Include and Lib folders, to the makefile.)
You also need to have a look at and install the dependencies mentioned in section 1. above.

#### 3.2.2. Editing the configure.in File

The configure.in file contains the user specific configuration parameters. Please have a look at this file and set the settings to match your system's settings.
Settings for Apache Axis2/C are mandatory. Settings for Apache Rampart/C and Apache Sandesha2/C are optional and needs to be set only if you want to build those.
The comments in the configure.in file explain each setting, please have a look at the comments to get an understanding on what each setting means.

#### 3.2.3. Compiling the Source

Extract the source distribution to a folder of your choice. (example: C:\wsfc) Edit the configure.in file and set the configure parameters to match your system.
Open a DOS shell, and go to the extracted source.

            > cd C:\wsfc

Run the build.bat batch file.

            > build.bat

(Note: You may need to set the PATH environment variable to vcvars32.bat if Windows displays a message indicating that it cannot find this batch file when running the build.bat file.)

#### 3.2.4. Running the Binaries

Please refer to step 2 of section 3.1.2. above.