Skip to end of metadata
Go to start of metadata

This sample demonstrates how to implement content negotiation in the Application Server. Content negotiation is a mechanism which allows to maintain multiple representations of the same resource, and serve the particular representation relevant to a given request and what the requesting server needs.

Building the sample 

  1. Open a command line, and navigate to the <AS_HOME>/samples/Jaxws-Jaxrs/jaxrs_content_negotiation directory.
  2. Run the relevant command to deploy the web app:
    • Using Maven

      1. Create a WAR file for the sample using the following command:

        mvn clean install
      2. Deploy the generated WAR file on WSO2 AS with the related logs on the console:

        mvn -Pdeploy
    • Using Ant

  3. Start  the WSO2 Application Server by executing one of the following commands, where <PRODUCT_HOME> is the directory where you installed the product distribution:

    On Windows
    <PRODUCT_HOME>\bin\wso2server.bat --run
    On Linux/Solaris
    sh <PRODUCT_HOME>/bin/wso2server.sh  
  4. Log in to the management console and click List on the Main menu, under Manage/Applications. This opens the Running Applications page. The deployed applications will be listed here.

  5. You can open the required web application by clicking the Find Services action.

Running the sample 

 A RESTful customer service is provided on URL http://localhost:9763/jaxrs_content_negotiation/services/.  Users access this URL to operate on a customer.  The REST server provides the following services:

  • No labels