|Apache | WS|
Axis C++ Server User's Guide
In order to use web services you need to create client-side stubs that access the service and, if you are also responsible for writing the service you need to create the service skeletons and then complete them. This document explains how to use the Axis CPP tooling (WSDL2Ws) to generate the server code. It then goes on to show how to deploy a generated service to an Apache webserver (and by implication the simple_axis_server).
WSDL2Ws is a 100% java tool and requires a version of Java to be on the machine that you create your stubs and skeletons on. The version of Java that is required is >= 1.4
Generating and deploying services
Generate the service skeletons
As with the client-side we will use the Calculator service to show you how to use the tooling and deploy the generated service to the server runtime
Inside the folder <Axis installation directory>/wsdls/ you will find Calculator.wsdl file which we will use to generate the server-side skeleton and Wrappers. Here is the command line arguments to generate the skeleton.
IMPORTANT:In this sample we generate the skeletons using Calculator.wsdl and the WSDL2Ws tool. But in the folder <Axis Installation directory>/samples/server/calculator you will find already generated files. If you wish to use those without generating new ones you can do so. We recommend that you deploy the sample with the already generated files in the first round and later do the same with code generated from Calculator.wsdl.
cd <Axis Installation directory>/samples/server/calculator
Code the Service
Now that you have generated your service skeletons you need to fill out the logic that the service will perform. As we've already mentioned, in the case of the calculator example we have given you pre-filled skeletons in the <Axis Installation directory>/samples/server/calculator directory to show you how it's done.
Build the service
For example: To build the service library (example using linux and g++)
g++ -shared -I<Axis Installation directory>/include -olibcalculator.so *.cpp
libcalculator.so is the name you give to your service library. You can give your own libraries any name you wish. But remember (on linux) to prefix with lib and suffix with .so.
Deploy the service
You can either deploy the file manually to the server or using a provided administration tool (AdminClient). The first section shows you how to deploy your Web Service manually, without using the AdminClient tool.
Deploying your service manually
Lets say that the Apache installation folder is <Apache_Folder>.
Deploying your service using the AdminClient Tool
As an alternative to manually deploying the service to the server you can use the AdminClient tool supplied with Axis CPP.
Checking your deployment configuration