Thursday, January 3, 2008

Client / Proxy for an Asynchronous Web Service using JDeveloper 11 TP 3

In my previous post I looked at a proposal to make it easier to implement asynchronous web services. There still remains the task of generating a suitable client to work with this service. Generally this will take the form of a proxy to invoke the "initialization" port type and a deployed web service that implements the "response"/"callback" port type. In general you would expect the async client to be deployed to a EE container to be properly managed.

Previously we would have made you generate the proxy and response port type manually; but the "Web Service Proxy" wizard in JDeveloper will now offer to generate the response service for you. In TP3 it will recognize any WSDL that contains a more than one port types that are related using a partnerLinkType as possibly an asynchronous service. (See here for an example) Once recognize the wizard give you give you the option to specify the package to generate the response service to:

You can of course un-tick the box and not generate a callback service if you want to. If you continue with the async case you will get both a skeleton client class and a skeleton service implementation is generated at the same time:

Not that in both the client we are generating boilerplate code to manage the WS-Addressing headers used to correlate the two different messages. This code is using the "AddressingHelper" class which is an oracle specific class; but note that it makes working with the headers so much easier. I will look into providing a non-oracle specific code example at some point when I get a few minutes together.

Unfortunately it appears that the web.xml and the correct deployment descriptors are not generated in the build that went out as TP3 but those are relatively easy to fix by hand or using the quick fixes in the code editor.

No comments: