If you're a travel industry developer writing an opentravel service on any platform or language, you will need a test web services client as part of your development infrastructure. Your client will send various messages to your service and then verify that the responses are correct.
The open source JiBX project contains tools for web services development, including a complete xml to java binding for the opentravel message schema.
When you combine the JiBX tools with all the of tools available for the java platform you have an excellent platform for testing your opentravel messaging.
Let's start with the JiBX web services client framework. The client framework is very flexible. It can be used by your client application, or used as a test platform. We'll be running our tests using the maven framework, but you can easily use straight java or run your tests in an OSGi container.
Now we're ready to customize our test code. Let's start with the code from our repository at: https://github.com/jibx/schema-library/tree/master/org.opentravel/_2012A/opentravel-ws/opentravel-hotel-ws-test-client. You should download this project and use it as your starting point.
Take a look at this source code here. Notice this source code in the start method:
Properties properties = new Properties();
runTest(properties); // By default, run the test once with no properties
This code is using the framework's ability to read a local message and marshal it to a Java object. You will see that all that is needed is the java class name and the message location (You will find these xml messages in the project's resource directory).
If you prefer unit tests, this project also contains a maven junit test. The source code is here.
If you scroll to the bottom of this code, you will see the checkResponseMessage method. You will notice that this method converts the java object to an xml string and prints it. It also converts the message to a DOM tree and does a test. The last line does an XPath test on the xml message.
This client code inherits code from the web services Utilities java class. Take a look at this code for the available tools.
This should be everything you need to write a web services client or a web services client test suite.Don Corley