JAX-RS Content Negotiation Demo
===============================

The demo shows how to do content negotiation so that the same resource can 
be served using multiple representations. 

A RESTful customer service is provided on URL http://localhost:9000/customers. 
Users access this URI to operate on customer.

A HTTP GET request to URL http://localhost:9000/customerservice/customers/123
with Accept header set to "application/xml" returns a customer instance in XML
format. The XML document returned:

<Customer>
  <id>123</id>
  <name>John</name>
</Customer>

A HTTP GET request to URL http://localhost:9000/customerservice/customers/123
with Accept header set to "application/json" returns a customer instance in JSON
format. The JSON document returned:

{"Customer":{"id":"123","name":"John"}}

A HTTP GET request to URL http://localhost:9000/customerservice/customers/123
without setting Accept header explicitly returns a customer instance in XML
format. This is because the Accept header will be absent from the request when using 
HTTP Client, in which case the CXF will treat the Accept content type as "*/*". 
The XML document returned:

{"Customer":{"id":"123","name":"John"}}

Please review the README in the samples directory before
continuing.



Building and running the demo using maven
---------------------------------------

From the base directory of this sample (i.e., where this README file is
located), the maven pom.xml file can be used to build and run the demo. 

Using either UNIX or Windows:

  * mvn clean install (builds the demo and creates a WAR file)
  * Start the server (run bin/wso2server.sh/.bat)
  * mvn -Pdeploy (deploys the generated WAR file on WSO2 AS with related logs on the console)
  * mvn -Pclient (runs the client)

To remove the target dir, run mvn clean".


