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 an open source web services platform such as servicemix and the tools available for java, you have an excellent platform for testing your opentravel messaging.
Let's start with the JiBX web services framework. Click on this link, and follow the directions to set up your web service.
If you need help setting up your test environment, take a look at this blog entry for step-by-step instructions on setting up a JiBX maven project in eclipse.
Now you're ready to customize your test code. Let's start with the code from our repository.
Take a look at this source code. In the res and resmodify method you will see some code like this:
Properties properties = new Properties(); properties.setProperty(BaseClient.FILENAME, "/OTA_HotelResRS.xml"); properties.setProperty(BaseClient.CLASSNAME, ResRQ.class.getName()); if (request.getOTAPayloadStdAttributes() != null) if (request.getOTAPayloadStdAttributes().getEchoToken() != null) if (request.getOTAPayloadStdAttributes().getEchoToken().startsWith("/")) properties.setProperty(BaseClient.FILENAME, request.getOTAPayloadStdAttributes().getEchoToken()); response = (ResRS)this.createMessage(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 message class and location (You will find this message in the https://github.com/jibx/schema-library/tree/master/org.opentravel/_2012A/opentravel-ws/opentravel-hotel-ws-test-service/src/main/resources directory). In this test scenario I also have the option to pass the pathname of the the response message in the request message's echotoken attribute.If you look at the checkpaymentcard method, you can see the power of using java objects to test for xml elements. This would be difficult to do in XPATH or DOM.public void checkPaymentCard(PaymentCard paymentCard) { if (paymentCard.getSeriesCode() != null) System.out.println("Good - Card info good"); else System.out.println("Error - Card info not good"); }The utilities in the JiBX web services test suite can be used in the client and service modules. For a description of the other utilities, see my opentravel client test suite blog.Cheers!Don Corleydon@tourgeek.com
6 comments:
I am deeply attracted by your post. It is really a nice and informative one. I will recommend it to my friends.
Product Description Writing Services In India
I'm in no doubt coming back again to read these articles and blogs.
best website design firms
They collaborated synergistically with the internal IT and marketing teams using an organized workflow.
website and logo design company
By efficiently scaling resources, thoughtbot produced accurate and timely deliverables cost-effectively.
web agency
You create sense out of the foremost complex topics.
UI design companies
This Man Won $15M at 카지노사이트 엠카지노회원가입, How Did He Do It?
Post a Comment