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

Implementing JAX-RPC handlers to access SDO messages

Service Data Objects (SDO) is an open standard for enabling applications to handle data from different data sources in a uniform way (as DataGraphs). The service integration bus Web services enablement uses an SDO repository (database) for storing and serving WSDL definitions.

JAX-RPC handlers are invoked by the IBM Web services run-time environment during processing of request and response messages. For messages that are exchanged using the SOAP protocol, each JAX-RPC handler is passed a SOAP-specific MessageContext object. For other protocols, the IBM Web services run-time environment passes a MessageContext object that provides an SDO view of the message.

If the JAX-RPC handler only deals with message context properties, then it does not need to be aware of the particular subclass of MessageContext that it is given, because the context property methods are defined by the MessageContext interface itself. If the handler needs to process information contained within the message, then it must be coded to work with the required subclasses. It is recommended that your JAX-RPC handlers test whether the MessageContext is an instance of the required subclass.

A JAX-RPC handler is given an SDO-specific MessageContext object (an instance of the com.ibm.websphere.webservices.handler.sdo.SDOMessageContext class) rather than the SOAP-specific MessageContext object in the following cases:
  • A JAX-RPC client or outbound invocation from the service integration bus invokes a service using the EJB binding.
  • A JAX-RPC client is developed against a non-bound WSDL and is retargeted to a destination in the service integration bus.

The SDOMessageContext class provides methods to get and set the com.ibm.websphere.sdo.SDOMessage instance that represents the actual message being processed. The SDOMessage in turn has a method to access the SDO DataGraph object that holds the message content as SDO DataObjects.

A JAX-RPC handler can modify the SDO DataGraph contents, but it cannot change the format or schema of the message.

Here is an example of the code that is used to access the SDO DataGraph from the MessageContext object in a JAX-RPC handler handleRequest method:

public boolean handleRequest(MessageContext messageContext) {

		// Convert the MessageContext into an SDOMessageContext
		if( messageContext instanceof SDOMessageContext) {
			SDOMessageContext smc = (SDOMessageContext)messageContext;

			// Retreive the message
			SDOMessage message = smc.getSDOMessage();
		
			// Get the root object in the SDO DataGraph
			DataGraph graph = message.getDataGraph();
			DataObject content = graph.getRootObject();
		
			// Now do something with the message content.....
		}
		return true;
	}
Related tasks
Working with JAX-RPC handlers and handler lists
Sending Web service messages directly over the bus from a JAX-RPC client
Installing the SDO repository

Reference topic

Terms of Use | Feedback

Last updated: 2 Aug 2005
http://publib.boulder.ibm.com/infocenter/ws60help/index.jsp?topic=/com.ibm.websphere.pmc.express.doc\ref\rjw_jaxrpc_sdo.html

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