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

You can use the Edit Maps and Interface dialog (shown in this topic) to override natural mapping for XML messages sent between your service and clients, other services, or other resources. You display the dialog by locating the item in Design View to which the map will apply and double-clicking the map icon (shown here) corresponding to it.

In the icon, an arrow pointing inward toward the area of your service represents a map applied to an incoming message; an arrow pointing outward represents a map applied to the outgoing data.

Note: When you use the Edit Maps and Interface dialog, you create an XML map that is stored with the source code of your JWS or CTRL file. XML maps can also be put in separate map files and used from multiple places in source code. For information differentiating the two locations, see How Do XML Maps Work?

The Edit Maps and Interface dialog provides tabs to display the parameter-xml map and return-xml map. For parameter-xml maps, the default XML displayed in the dialog uses element names that match your parameter names; for return-xml maps, the default element name is simply <return>.

Before beginning an XML map you should obtain a sample copy of an XML message that your method will be expected to handle or generate. The element and attribute names within your XML map must match those in the XML message to be mapped; this is an essential aspect of XML maps. Examine the structure of the example XML to identify the elements and attributes that will contain values that should be mapped to your method's parameters. Identify a section of the XML that contains the elements corresponding to your implementation, then use this section as a basis for the XML map.

To Begin a Custom XML Map

1. Double-click the map icon corresponding to the method, callback, or callback handler to which you are applying the map.

The Edit Maps and Interface dialog appears, as shown here:

2. Click one of the following tabs, as appropriate:

- Click the Parameter XML tab to map XML values to the parameters of your Java declaration

- Click the Return XML tab to map XML values to the return value of your Java declaration.

For more information on parameter-xml and return-xml maps, see How Do XML Maps Work?

3. In the XML pane, paste the section of example XML you identified.

4. Edit the XML you pasted, replacing actual content with substitution directives. For more information on substitution directives see How Do XML Maps Work?

5. Click OK to store your edited XML map in the source code of your service.

6. To edit the XML map, double-click the corresponding map icon in Design View or edit the map directly in Source View.

Related Topics

Edit Maps and Interface Dialog (General)

Matching XML Shapes

How Do XML Maps Work?