This documentation is for WSO2 Application Server version 5.0.0. View documentation for the latest release.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Introducing the Sample

The sample shows a basic REST-based Web Services using JAX-RS (JSR-311). The REST server provides the following services:   

<Customer>
   <id>123</id>
   <name>John</name>
</Customer>
  • A HTTP GET request to URL ${serviceURL}/orders/223/products/323 returns product 323 that belongs to order 223. The XML document returns the following:
<Product>
   <description>product 323</description>
   <id>323</id>
</Product>
  • A HTTP POST request to URL ${serviceURL}/customers with the following data adds a customer whose name is Jack.
<Customer>
   <name>Jack</name>
</Customer>
  •  A HTTP PUT request to URL ${serviceURL}/customers with following data updates the customer instance whose id is 123.
<Customer>
   <id>123</id>
   <name>John</name>
</Customer>

The client code demonstrates how to send HTTP GET/POST/PUT/DELETE requests whereas the server code demonstrates how to build a RESTful endpoint through  JAX-RS (JSR-311) APIs.


  • No labels