You can use the XQuery Mapper dialog to override natural mapping for XML messages sent between your service and clients, other services, or other resources. The dialog provides tabs to display the parameter-xml map and return-xml map. You display the dialog in Design View by double-clicking the method to which the map will apply.
XQuery maps are designed to map one schema to another. When you create an XQuery map, you have the XML schema (XSD) file defining the message you will be mapping. The other schema is derived from your Java signature by WebLogic Workshop. When mapping, you define XQuery expressions that express how parts of one message fit into the shape of the other message.
Keep in mind when mapping that a web service operation expects the incoming message to be of a particular shape — for example, a shape that shows the method name as the only child of the soap body element. For example, the following operation method:
public String[] getTitles(String[] title) { ... }
will have an inbound shape like this:
<getTitles> <title> <String>book 1 title</String> <String>book 2 title</String> </title> <getTitles>
To Begin a Custom XQuery Map
For more information on schema projects and compiling schema, see How Do I: Use XML Schema in WebLogic Workshop?
The XQuery Mapper dialog appears, as shown here:
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.
The XQuery Mapper dialog displays a sample of the XML message defined by the schema you selected.
On the left, under Source Schema, you will see a representation of parts of the XML as defined in your schema. On the right, under Target Schema, you will see the schema derived by WebLogic Workshop from your Java signature.
For simple maps, the edit process is purely graphical. To create a simple map, you click a schema part under source schema, then drag over to the target schema, dropping it on the schema part to which you want to map it. This is illustrated here:
The lower pane will expand to display a function builder which you can use to edit the XQuery function for each part of your map. Note that you can type in the Edit Function pane. You can drag function names from the categorized function list on the left, then drop them in the center pane. You can also drag parameter names from the right into the center pane.
To view the complete XQuery as you edit, click the XQuery tab at the top of the dialog. To test your map, click the Test tab, then click the Test button.
For examples of both simple and complex maps, see the XQuery map samples provided with WebLogic Workshop, in the SamplesApp application.