Deprecated. XML Maps are deprecated as of the WebLogic Platform 8.1 release. For new code, use XQuery maps. For more information, see Introduction to XQuery Maps.

How Do I: Handle Incoming XML Messages of a Particular Shape?

When your service must handle a particular incoming XML message shape, you can create an XML map as an translation layer between the incoming message and the Java parameters that your method expects. XML maps are particularly useful in cases where a web service you develop must respond to messages whose shape is beyond your control. Maps enable you to handle those messages without changing your code.

In the simplest example, you specify this mapping with substitution directive such as {} for the XML element value you want to map. In the following example, parameters in the declaration are mapped to element and attribute values.

/**
 * @common:operation
 * @jws:parameter-xml xml-map::
 *   <searchRequest>
 *     <partName partID="{serialNumber}">{productName}</partName>
 *     <number>{quantity}</number>
 *   </searchRequest>
 * ::
 */
public String searchRequest (String productName, String serialNumber, int quantity)

Note: You will find an introduction to XML maps at Why Use XML Maps?

Depending on how the incoming message arrives at your service, you will create a map that converts an XML message into the parameters of your Java method. The following section lists the four circumstances under which an incoming XML message can arrive at your service, and describes which kind of map you should use for each.

Note: For each of the incoming message source described in this topic, there is a related outgoing message source. For more information on mapping to shape outgoing messages, see How Do I: Ensure that Outgoing XML Messages Conform to a Particular Shape.

An incoming message can arrive:

Related Topics

Why Use XML Maps?

How Do I: Ensure That Outgoing XML Conforms to a Particular Shape?

How Do I: Add or Edit an XML Map with the Edit Maps and Interface Dialog?

Using Callbacks to Notify Clients of Events

JCX File: Extending Controls the topic titles linked to and from are different