This documentation is for WSO2 Application Server 5.2.1. View documentation for the latest release.
Building and Running JAX-WS Samples - Application Server 5.2.1 - WSO2 Documentation
Skip to end of metadata
Go to start of metadata

Using Maven

Follow the steps given below before you build and run the sample.

  1. Remove the following parent POM reference from the sample's pom.xml file, which is stored in the <PRODUCT_HOME>\samples\ directory.


    Note that this step is necessary because of a known issue, which will be fixed in AS 6.0.0.

  2. As shown below, add the <version> and <groupid> elements to the pom.xml file, after the parent element which you commented out in the first step.


To build and run the sample:

  1. Open the maven pom.xml file, which is in the base directory of the sample (i.e.,  <PRODUCT_HOME>\samples\Jaxws-Jaxrs\<JAX-WS-Sample-Folder>). To determine  <JAX-WS-Sample>, see JAX-WS Sample Folder.
  2. Build the demo and create a WAR file.

    mvn clean install ()
  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/            
  4. Deploy the generated WAR file on WSO2 AS with the related logs on the console.

    mvn -Pdeploy
  5. Run the client

    mvn -Pclient

If you wish to remove the target directory:

run mvn clean

Using Apache Ant

You need Apache Ant 1.6.2 or higher  to build the samples.


  1. To deploy the sample  service on the server run the following command, from the  <PRODUCT_HOME>\samples\Jaxws-Jaxrs\<JAX-RS-Sample-Folder> directory. To determine <JAX-WS-Sample>, see JAX-WS Sample Folder.

  2. Start the application server and access its Management Console at https://localhost:9443/carbon.
  3. On the Main menu, under Services, click List.
    The Deployed Services window will appear.
  4. Click on the respective JAX-RS sample (e.g., async_jaxws).
  5. Execute one of the following commands to run the client:

    On Windows
    On Linux/Solaris


  6. Try the sample with different QoS options that appear on its dashboard. 
  7. For different options run:

    sh -help


JAX-WS Sample Folder
SampleJAX-WS Sample Folder

Asynchronous Invocation


Build and Invoke a Service Using a WSDL


Develop Services in Code-First Approach


JAX-WS Handlers


MTOM Sample for SWA and XOP


WS-Security Sample on Signature and Encryption

sign_encrypt _jaxws

WS-Security Sample on UsernameToken and Timestamp


  • No labels