Popular Posts

Saturday, May 31, 2008

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.

Sunday, May 25, 2008

HTTP Compression

I wasn't much aware of HTTP compression though I heard the term often. Thanks to a nice article written by Martin Brown, I was able to get a basic understanding as well as how to get Apache and IIS servers configured to use HTTP compression.
HTTP compression is an mechanism to utilize the available bandwidth effectively. HTTP protocol data is compressed before it is sent from the server. No specific configuration is required at the client side and server configuration is also relatively simple.
If you are involved in web performance testing, It would be worthwhile to get some knowledge on HTTP compression.

Saturday, May 10, 2008

Weblogic application classloading

We wanted to use our own stax parser implementation in a web application deployed on Weblogic 9.2. The user guides and BEA forums suggested two approaches.

1. Using weblogic.xml web application deployment descriptor with <prefer-web-inf-classes> element. Setting this to true allows a Web application to use our own version of a third-party class

2. Using filtering classloader
Here we are allowed to explicitly specify packages which are required to be loaded from the application. These packages can be listed in weblogic-application.xml

I tried both approaches separately in order to use wstx-asl-3.2.1.jar shipped with our application instead of loading weblogic stax parser.

Unfortunately, both class loading mechanisms failed to pick up our stax parser :(

We even tried to hack weblogic.jar by editing property files which tightly map the parser interface to the impl*. We extracted weblogic.jar and edited the stax impl class entries (i.e:- com.ctc.wstx.sax.WstxSAXParserFactory) of the following 4 files included in META-INF/services directory.
javax.xml.parsers.SAXParserFactory
javax.xml.stream.XMLEventFactory
javax.xml.stream.XMLInputFactory
javax.xml.stream.XMLOutputFactory

However, weblogic reported version conflicting issue when restarting server with the edited weblogic.jar.
I did not encounter these class loading problems with JBoss or tomcat. I'm uncertain about why it is such a pain in configuring a commercial product like Weblogic to use application specific packages.

Thursday, May 1, 2008

Gartner lists wso2 as a cool vendor in web technologies

WSO2 has been chosen as a cool vendor in web technologies by Gartner. More information can be found at Pauls' blog

Axis2 session management - Transport session

Apache Axis2 provides session handling capability using 4 session scopes; request, soapsession, transport and application. I have already blogged about application scope a few months ago.

Axis2 transportsession uses transport level session management techniques to manage sessions of a Web service. Life time of a session is governed by the underlined transport, not by Axis2 itself. If a service is deployed in a transportsession scope, then, there will be service instances for each of the transport session.

You can read my recent Knowledge base post on how to manage sessions with transport session scope here at wso2 oxygen tank.