InputMapMultiple.jws Sample

Demonstrates the use of a @jws:parameter-xml tag defining an XML map to convert XML input to Java objects, including an indeterminate length list of elements using the <xm:multiple> attribute.

# Concepts Demonstrated by this Sample

- XML maps

- Specification of repeating elements in an XML<->Java conversion using the <xm:multiple> attribute

# Location of Sample Files

This sample is located in the xmlmap folder of the samples WebLogic Workshop project. In the file system the location is:

BEA_HOME\weblogic700\samples\workshop\applications\samples\xmlmap\InputMapMultiple.jws

# How to Run the Sample

To run this web service:

1. Start WebLogic Server in the appropriate domain.

   - On Microsoft Windows systems, from the Start menu navigate to:

   BEA WebLogic Platform 7.0->WebLogic Workshop->WebLogic Workshop Examples->Start Examples Server.

   - On Linux or Solaris systems, run:

   BEA_HOME/weblogic700/samples/workshop/startWebLogic.sh

2. Launch the service either by opening it in WebLogic Workshop and selecting the Start operation or by entering http://localhost:7001/samples/xmlmap/InputMapMultiple.jws in the address bar of your browser. If WebLogic Server is running in the appropriate domain on this machine, you may click here to run the sample.

3. Navigate to the Test Form tab of Test View, if necessary.

4. The single method of the web service, getTotalPrice, specifies an XML map for incoming data. The Test Form displays a default map conforming to the expected schema.

5. Enter values for each of the XML tag values that start with Value_ (replace the entire text string with a new value).

6. Invoke the getTotalPrice method.

7. getTotalPrice extracts the data from the XML map into Java parameters to the method, computes the total price of the submitted order, then returns a single floating point value.

8. Note that there are multiple sibling <item> elements in the expected schema. The <xm:multiple> attribute specified in getTotalPrice's XML map allows it to accept an indeterminate number of sibling <item> elements as input.

Related Topics

OutputScriptMap.jws Sample

Handling and Shaping XML Messages with XML Maps

<xm:multiple> Attribute

@jws:parameter-xml Tag

@jws:return-xml Tag

Test View