Exposing an Axis1 service through WSO2 WSAS
Do you want to make use of the powerful QOS features of Axis2 with your legacy Axis1 applications? Yes it is possible with WSO2 Web services application server. It allows easy deployment of any Apache Axis1-based Web service and engage advanced WS-* services, such as WS-RM and WS-Policy in front of legacy Axis1 services.
Lets see how we can use this cool feature.
Step 1
Write the service impl class.
package org.wso2.wsas.service;
public class Calculator{
public int addition(int x, int y){
return x+y;
}
public int multiplication(int a, int b){
return a*b;
}
public int subtraction(int c, int d){
return c-d;
}
public double division(double m, double n){
return m/n;
}
}
Compile and make a jar with the above class. Suppose it is Axis1resources.jar
Step 2
Write the deployment descriptor (*.wsdd) for your service impl class and save it as calculator.wsdd
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="Axis1calculator" style="wrapped">
<parameter name="className" value="org.wso2.wsas.service.Calculator"/>
<parameter name="allowedMethods" value="*"/>
</service>
</deployment>
Step 3
Start WSO2 WSAS (If you haven't downloaded it yet, get it from http://wso2.org/projects/wsas/java
Access WSO2 WSAS management console using https://localhost:9443 (Default admin user credentials are admin/admin)
Go to Services and service group management page and click on "Upload Axis1 service" link. You will be directed to the following page
Browse for the above calculator.wsdd and Axis1resources.jar and click on Upload. Axis1 service will be deployed on WSAS and you will get a confirmation message.
Step 4
If the deployment is successful, you will see the Axis1 service is shown in the services and service group management page.
Click on "Axis1calculator" service.
In the "Service Management" page, select "Tryit"
Invoke service using some inputs and see the output.
Lets see how we can use this cool feature.
Step 1
Write the service impl class.
package org.wso2.wsas.service;
public class Calculator{
public int addition(int x, int y){
return x+y;
}
public int multiplication(int a, int b){
return a*b;
}
public int subtraction(int c, int d){
return c-d;
}
public double division(double m, double n){
return m/n;
}
}
Compile and make a jar with the above class. Suppose it is Axis1resources.jar
Step 2
Write the deployment descriptor (*.wsdd) for your service impl class and save it as calculator.wsdd
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="Axis1calculator" style="wrapped">
<parameter name="className" value="org.wso2.wsas.service.Calculator"/>
<parameter name="allowedMethods" value="*"/>
</service>
</deployment>
Step 3
Start WSO2 WSAS (If you haven't downloaded it yet, get it from http://wso2.org/projects/wsas/java
Access WSO2 WSAS management console using https://localhost:9443 (Default admin user credentials are admin/admin)
Go to Services and service group management page and click on "Upload Axis1 service" link. You will be directed to the following page
Browse for the above calculator.wsdd and Axis1resources.jar and click on Upload. Axis1 service will be deployed on WSAS and you will get a confirmation message.
Step 4
If the deployment is successful, you will see the Axis1 service is shown in the services and service group management page.
Click on "Axis1calculator" service.
In the "Service Management" page, select "Tryit"
Invoke service using some inputs and see the output.
Comments