WSO2 Web Services Framework for C - Install Guide
=============================================

1. Software Dependencies

1.1. Mandatory

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

1.2. Optional

    * Libxml2 - http://www.xmlsoft.org/
    * 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.
The following steps need to be taken to install and run WSF/C using 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 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 possible configuration options.
      Note :If you do not provide a --prefix configure option, it will by default be installed into /opt/wso2/wsf_c directory.
   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 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 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 

      6. Running Sandesha/C, Rampart/C and Savan/C samples.
         Plesae refer the INSTALL files in sandesha2c, rampartc and savanc

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 the 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 the step 5 in section 2.1. above

3. Installing and Running on Microsoft Windows (Win32)

This can be done using either binary or source distribution.

3. 1. Using 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 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)
   2. 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 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 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 nmake build tool.
(Note: You can download Microsoft VSExpress2005 edition and Platform SDK from Microsoft Web site. You will need to add the path to Platform SDK Include and Lib folders to makefile)
You also need have a look at and install the dependencies mentioned in section 1. above.

3.2.2. Editing 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 where the extracted source is

        > 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 complaints that it cannot find this batch file when running the build.bat file)

3.2.4. Running The Binaries
Please have a look at the step 2 of section 3.1.2. above. 
