|Apache | WS|
Axis C++ Developer's Guide
This guide is meant to be read by those of you who would like to check out the code and create either a new transport layer or new parser layer. If you just want to check out the code and build it yourself e.g. because you want to port it to a new new platform then please see the build guide.
Checking out source code
The source code for Axis C++ is held in SVN. Instructions for using the Apache SVN system can be found here. The Axis C++ repository is http://svn.apache.org/repos/asf/webservices/axis/trunk/c.
Creating and Building your own transport layer
When creating your own transport layer refer SoapTransport.h header file for API.To see an example implementation refer AxisTransport.h and AxisTransport.cpp
Implement SoapTransport.h interface according to rules described in the header file.
CreateInstance (SoapTransport *pOut)- Used by Axis to create an instance of your transport class
Compile your transport code and build a dynamic library. Add the name of your transport library to axis configuration file (axiscpp.conf) so that Axis can find your library at runtime.
Debugging client problems using the MockServer
Within the ant test framework we have what we call a 'MockServer'. This is a 100 percent Java tool that allows you to send back any response that you wish to the client. This tool can be particularly useful for debugging problems in the client that come from the mailing list. You need the users WSDL (to create the stubs) and ask them to capture the response from the server (or you can make this by-hand if you wish it's just a bit harder).
Here are some simple instruction on using the MockServer utility we use for testing Axis c++ client without a server outside of the mockserver. Compile mock server java code (found within <Axis extract root >/tests/utils/monitor )
Run the mock server: java org.apache.test.MockServer -p <port> -r <server response file>
The server response file is a text file containing the full HTTP response, it will look something like this:
The easiest way to generate this file is to capture the communication from a real server but if that isn't possible you will need to generate by hand (plenty of examples within <extract root>/test/auto_build/testcases/output ) Rather than providing the specific chunk size (1ad, on the line ahead of the payload) you can provide ### and the MockServer will calculate the correct size.
If your testcase makes multiple calls to the web service, you can simply append all the requests (in the correct order!) within the server response file.
Once the test has been completed you need to run the following to stop the server:
Creating and Building your own parser
Note:Implement XMLParser.h interface according to the rules described in the header file.
When creating your own parser refer XMLParser.h header file for API. To see an example implementation refer SoapParserXerces.h and SoapParserXerces.cpp.
Axis loads the parser dynamic library through following export functions which you also have to implement.
CreateInstance() - Used by Axis to create an instance of your parser class
Compile your parser code and build a dynamic library. Add the name of your parser library to Axis configuration file (axiscpp.conf) so that Axis can find your library at runtime
Adding support for extra platforms
Instructions for adding an extra platform to the ANT build scripts can found here.
If you need to make any modifications to the code specific to your platform we ask that you make the appropriate updates in the platform abstraction layer, by doing the following:
If you need to change something that has not been previously abstracted please ensure you update the other platforms to contain the existing code.