Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introducing the Sample

The sample shows some advanced functionalities of REST-based Web Services using JAX-RS (JSR-311). The REST server provides the following services:   

...

Code Block
languagejava
{
   "Order":{
       "orderId":"123",
       "drinkName":"Vanilla Flavored Coffee",
       "additions":"Milk",
       "locked":false
   }
}
 
  • A HTTP POST request to URL ${serviceURL}/orders  with the following data adds an order.

...

This sample can be found at <CARBON_HOME>\samples\Jaxws-Jaxrs\jaxrs_ sample_02 .  

Building and Running the Sample    

Using Maven

1. Install and run the WSO2 Application Server. Refer to the  Installation Guide Installing Features for instructions.

2. From the base directory of this sample ( <CARBON_HOME>\samples\Jaxws-Jaxrs\jaxrs_ sample_02 ) , the maven pom.xml file can be used to build and run the sample using either UNIX or Windows.

...

  • mvn -Pdeploy (deploys the generated WAR file on WSO2 AS with related logs on the console)
  • mvn -Pclient (runs the client)

Using Apache Ant  

  1. Run "ant" on  <CARBON_HOME>\samples\Jaxws-Jaxrs\jaxrs_ sample_02 directory to deploy the jaxrs_sample_02 service on the server.

...

5. Try the sample with different QoS options which appear on its dashboard. Run "sh run-client.sh -help" for different options.

...