|Apache | WS|
Axis C++ Client User's Guide
Generating and using client -stubs
In order to use web services you need to create client-side stubs that help you to access the service You then use these stubs within your application.
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 using client-side stubs
AxisCPP has Java based tooling. If you supply the WSDL which describes your service then WSDL2Ws will produce client-side stubs for you. All you need to do is create your application that uses those stubs. Throughout this section we will use the Calculator service that comes with Axis as an example of how to use the tooling.
Note: In order to run the application discussed below you need the "calculator" service deployed to a server. If you don't want to deploy the calculator service then you need to follow the instructions below but use your own WSDL files that describe your service. If you do want to deploy the calculator service for Apache web server or the simple_axis_server please go here. Once you've deployed your service then come back to these instructions and run the calculator client..
Generating Calculator client C++ classes
Firstly copy the Calculator wsdl to the client samples directory e.g. (linux)
cd <Axis installation directory>/samples/client/calculator
cp -f <Axis installation directory>/wsdls/Calculator.wsdl ./
IMPORTANT:In this example we are showing you how to use the WSDL2Ws tooling to generate the stubs using Calculator.wsdl. However, in the <Axis installation directory>/samples/client/calculator folder you will already find generated files. If you wish to use those without generating new ones you can do so. We recommend that you run the calculator sample with the already generated files firstly and later practice using the tooling with Calculator.wsdl.
Note: Don't forget to add all of the pre-requisite jar files into your classpath
java org.apache.axis.wsdl.wsdl2ws.WSDL2Ws Calculator.wsdl -lc++ -sclient
Now build your client application with your compiler of choice (in this example we have used g++ on a linux system)
Now that you've done the sample here you can go on and create your own services and clients using your own service definitions files (WSDL's).