WebSphere WebSphere Application Server Network Deployment, Version 6.0.x Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Sending Web service messages directly over the bus from a JAX-RPC client

Java API for XML-based remote procedure calls (JAX-RPC) client applications send and receive Web service request and response messages. JAX-RPC client applications using the IBM JAX-RPC run-time environment can do this in a number of different ways, depending on the bindings in the WSDL document that they are developed against, and the configuration data that is used at run time.

If you want to use a JAX-RPC client to send messages over the service integration bus, you have two choices:
Retargeting involves setting the following two values into the client application deployment descriptor, or specifying them dynamically at run time from within the client application:
The destination also needs to be configured so that it knows the port type of messages that the JAX-RPC client is using. There are two ways to achieve this:

To have Web service messages sent directly to a destination using a JAX-RPC client, complete the following steps:

  1. Create the JAX-RPC client application.
  2. Create the outbound service or inbound service with which you want the JAX-RPC client application to exchange messages.
  3. Use the administrative console to access the port information for your JAX-RPC client application, as described in Configuring Web service client bindings and Web services client port information.
  4. Override the default SOAP binding for your JAX-RPC client application. Change the binding namespace to http://www.ibm.com/ns/2004/02/wsdl/mp/sib
  5. Override the endpoint that your JAX-RPC client application uses to send Web service requests. The new endpoint should use the sib: URL syntax and include either the outbound service destination name, or both the inbound service name and its corresponding destination name.

After you change the binding namespace, any JAX-RPC handlers that were configured for the retargeted port are ignored. For clients that are developed against WSDL with a SOAP binding, retargeting directly to the bus causes the handlers to be ignored. However if the client is developed against the non-bound WSDL for the service, retargeting to the bus is not considered to be changing the binding namespace, and so the handler information is retained. In this case the JAX-RPC handlers are called with the SDOMessageContext subclass.

JAX-RPC clients can also be retargeted programmatically by adding the following code to the client application, to set properties on the JAX-RPC stub that the application uses to make the Web service invocation. In the following example code, the first line sets the namespace that indicates that messages are to be sent directly over the bus, and the second line sets the endpoint address that defines the name of the destination to which messages are sent:
((javax.xml.rpc.Stub)stub)._setProperty(
     com.ibm.websphere.webservices.Constants.PROTOCOL_NAMESPACE,
     "http://www.ibm.com/ns/2004/02/wsdl/mp/sib");
((javax.xml.rpc.Stub)stub)._setProperty(
     javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,
     "sib:/destination?destinationName=Bus1:StockQuoteDestination");

Associated reference topic:

Related tasks
Working with JAX-RPC handlers and handler lists
Related reference
Implementing JAX-RPC handlers to access SDO messages

Task topic

Terms of Use | Feedback

Last updated: 5 Oct 2005
http://publib.boulder.ibm.com/infocenter/ws60help/index.jsp?topic=/com.ibm.websphere.pmc.nd.doc\tasks\tjw_jaxrpc_client.html

© Copyright IBM Corporation 2004, 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)