Table of Contents | ||||
---|---|---|---|---|
|
Using Maven
Follow the steps given below before you build and run the sample.
Remove the following parent POM reference from the sample's pom.xml file, which is stored in the
<PRODUCT_HOME>\samples\
directory.Code Block <parent> <groupId>org.wso2.appserver</groupId> <artifactId>wso2appserver-samples-parent</artifactId> <version>5.2.1</version> </parent>
Note Note that this step is necessary because of a known issue, which will be fixed in AS 6.0.0.
As shown below, add the
<version>
and<groupid>
elements to thepom.xml
file, after the parent element which you commented out in the first step.Code Block <groupId>org.wso2.appserver</groupId> <version>5.2.1</version>
To build and run the sample:
...
:
- Open the sample folder in your product pack using a command line: Go to the
<PRODUCT_HOME>/samples/Jaxws-Jaxrs
directory. Select one of the JAX-WS Sample Folders. Build the demo and create a WAR file using the following command.
Code Block mvn clean install ()
Deploy the generated WAR file in WSO2 AS with the related logs on the console using the following command:
Code Block mvn -Pdeploy
This command will copy the WAR file to the
<AS_HOME>/repository/deployment/server/webapps
directory.Start the WSO2 Application Server by executing one of the following commands, where
<PRODUCT_HOME>
is the directory where you installed the product distribution:OS Command On Windows <PRODUCT_HOME>\bin\wso2server.bat --run
On Linux/Solaris sh <PRODUCT_HOME>/bin/wso2server.sh
Deploy the generated WAR file on WSO2 AS with the related logs on the console.
Code Block mvn -Pdeploy
Run the client
Code Block mvn -Pclient
If you wish to remove the target directory:
...
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.
You can open the required web application by clicking the Find Services action.
Info | ||
---|---|---|
If you want to remove the target directory, run the following command inside the
|
Using Apache Ant
Info |
---|
You need Apache Ant 1.6.2 or higher to build the samples. |
To deploy the sample service on the server run the following command, from Open the sample folder in your product pack using a command line and go to the
<PRODUCT_HOME>\samples\Jaxws-Jaxrs\<JAX-RSWS-Sample-Folder>
directory. To determine <JAX-WS-Sample>, seeFolder>
directory. The folders for Jax-rs samples are listed here: JAX-WS Sample Folder.To deploy the sample, run the following command:
Code Block ant
- Start the application server and access its Management Console at https://localhost:9443/carbon.
- On the Main menu, under Services, click List.
The Deployed Services window will appear. - Click on the respective JAX-RS sample (e.g., async_jaxws).
- Execute one of the following commands to run the clientApplication Server and log in to the management console.
- You can run the sample in two ways:
- Log in to the management console. On the Main menu, under Manage/Applications, click List to open the Running Applications page. The deployed applications will be listed here.
Using the command line, go the JAX-WS sample directory and execute the following command:
OS Command On Windows run-client.bat On Linux/Solaris sh
run-client.sh
The results of the sample will show on the command line.
Info | ||
---|---|---|
For different options, run:
|
...
JAX-WS Sample Folder
Sample | JAX-WS Sample Folder |
---|---|
Asynchronous Invocation | async_jaxws |
Build and Invoke a Service Using a WSDL | wsdl_first_jaxws |
Develop Services in Code-First Approach | java_first_jaxws |
JAX-WS Handlers | handlers_jaxws |
MTOM Sample for SWA and XOP | mtom_jaxws |
WS-Security Sample on Signature and Encryption | sign_encrypt _jaxws |
WS-Security Sample on UsernameToken and Timestamp | ws_security\ut |