OutputMap.jws Sample

Demonstrates use of the @jws:return-xml tag and implicit <xm:value> tags to convert Java objects to elements in an XML document that is returned to the web service's caller.

Concepts Demonstrated by this Sample

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\OutputMap.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/OutputMap.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. Enter values for fname and lname and invoke the Hello method.

  5. The Hello method receives the values using the default mapping (no custom XML map), but returns its result using an XML map specified with the @jws:return-xml tag.

  6. The XML map formats the fields of the Person object into the schema specified in the map, then returns that XML to the client.

Related Topics

InputMapMultiple.jws Sample

Handling and Shaping XML Messages with XML Maps

@jws:return-xml Tag

Test View