How to Call WSDL service using Axis2/C and Staff in windows

Post date: May 27, 2011 3:14:55 PM

Introduction

Guide to install WSF Staff under Windows.

Details

0. Environment variables

While compiling, starting Axis2/C or any client/service application, these environment variables, must set:

AXIS2C_HOME=c:\ws\axis2c

STAFF_HOME=c:\ws\staff

PATH=%PATH%;%AXIS2C_HOME%/bin;%AXIS2C_HOME%/lib;%STAFF_HOME%/bin;%STAFF_HOME%/lib

While compiling DAS providers MySQL and PostgreSQL this variables must set to DBMS home:

MYSQL_HOME=c:\Program Files\MySQL\MySQL Server 5.1

POSTGRESQL_HOME=c:\Program Files\PostgreSQL\8.3

If You do not needed PostgreSQL or MySQL provider, do not set corresponding variable.

You can set these variables in system properties. After setting these variables, You must re-login or reboot windows.

1. Compile and install dependencies

You need axis2/c-1.5.0 or greater to be installed. Please, refer to http://ws.apache.org/axis2/c/download.cgi.

Unpack directory contents axis2c-bin-1.5.0-win32 into c:\ws\axis2c

Make sure that Axis2/С starts:

c:\ws\axis2c\bin\axis2_http_server.exe

It must be console window with text:

Started Simple Axis2 HTTP Server ...

If You encounter some errors, please refer to Axis2/C site or get ws-win32-bin*.7z from our download section.

Make sure, that Axis2/C is working properly, take a look at: http://localhost:9090/axis2/services/ It must be Axis2/С service list.

2. Getting source code

Please refer to http://code.google.com/p/staff/source/checkout to read guide for getting source code from svn repository. Or checkout the Download section.

3. Compiling and installing

The compilation is available from the command line and from the IDE. You must choose variant do you like, 3.1 or 3.2.

3.1 Compiling and installing from command line

Note: If You using VS2008 or greater, solution upgrading must made automatically.

Open command prompt from staff directory and start:

  build <TARGET>

where <TARGET> is version to build: Debug or Release (case sensitive).

When build successes, start:

  install

3.2 Compiling from Visual Studio

Note: If You using VS2008 or greater, after opening this solution "Visual Studio Conversion Wizard" will be appear. Process solution upgrade to continue.

To compile from the IDE Visual Studio:

Open rise.sln from the directory rise, then build the solution (menu Build->Build Solution). Open staff.sln from the directory staff, then build the solution (menu Build->Build Solution).

To install open command prompt from staff directory and start:

 

 install

4. Starting

4.1 Starting in normal mode

To start Axis2/C in normal mode:

cd %AXIS2C_HOME%\bin

axis2_http_server

4.2 Starting in debug mode

To start Axis2/C in debug mode:

cd %AXIS2C_HOME%\bin

set RISE_LOG_LEVEL=DEBUG3

set RISE_EXCEPTION_STACKTRACING=1

axis2_http_server

5. Testing

5.1 Basic test

Open the web-browser and enter:

http://localhost:9090/axis2/services

Sample services "samples.calc.CalcService", "samples.calc.SubService" must running.

5.2 Service-Client interaction test

Open command prompt and start calc client:

%STAFF_HOME%\samples\bin\calc_client

Screen output:

INFO main.cpp[49]: main: 1 + 2 = 3

INFO main.cpp[51]: main: 3 - 1 = 2

INFO main.cpp[53]: main: Saved service mem: 0

INFO main.cpp[58]: main: Setting mem: 46

INFO main.cpp[60]: main: 46

INFO main.cpp[61]: main: Service mem: 46