Posts

Showing posts from 2007

Deploying an axis2 service in application scope

If you deploy a service without specifying a scope, it will be considered as sessionless and will be deployed in request session scope. In other words, request scope is the default session scope of an axis2 web service. When a service is deployed in request session scope, an instance of the service implementation class is created for every invocation. Suppose you want to get rid of that and maintain a single instance of service class throughout the server life time. Then you should deploy the service in application session scope. Lets see how it can be achieved and tested the service invocation using WSO2 WSAS. First, create a simple java bean as follows. public class Employee { private int Age; private String name; private String emp_id; public int getAge() { return Age; } public void setAge(int age) { Age = age; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getEmp_id() {

Web application testing with Httpunit

Recently I wrote a tutorial on using httpunit to test Axis2 web module, which was published in wso2 oxygen tank . Httpunit provides a set of APIs to test a web application even without opening a browser, so that httpunit tests can be easily integrated in to your nightly build system. Have a look!!!

An easy way to deploy pojo based Axis2 web services

Ever wonder deploying axis2 web services without archiving them in aars? There is an easy way to deploy axis2 web services directly inside any servlet container. Lets see how this simple deployment can be done.. If you haven't configured axis2 yet, get latest version from here Simply copy axis2.war file in to the webapps directory of your favorite servlet container. Assuming apache tomcat 6 as the servlet container, axis2.war should be copied to ..\apache-tomcat-6.0.10\webapps. Start tomcat. axi2.war will be deployed inside tomcat. Now you have to tell Axis2 to expose files in the given formats as web services. It can be done by adding the following custom element in to axis2.xml which can be found at ..\apache-tomcat-6.0.10\webapps\axis2\WEB-INF\conf\. <deployer extension=".class" directory="pojo" class="org.apache.axis2.deployment.POJODeployer"> This simply says, the files with the extension .class which are placed at pojo directory will be ex

Creating and deploying Java web services using Eclipse WTP and WSO2 WSAS

Recently WSO2 has worked with Eclipse WTP team to integrate wso2 Web Services Application Server (WSAS) in to Eclipse WTP (Web Tools Platform). This greatly reduces the effort of developing java web services and it will definitely a revolutionary tool for web service developers. I would like to introduce a few nice features of this user friendly tool, so that anybody can start to use it for java web services development. In order to use this integrated tool kit, WSO2 web services application server has to be downloaded to your local server. Get the latest WSAS binary distribution from here. Just unzip it to your local file system. Suppose it is placed at C:\webservices\wso2wsas-2.0. Now you have to download Eclipse WTP. An Stable WTP build can be downloaded from Eclipse web tools project . I would recommend you to get the wtp-all-in-one package. Unzip the wtp distribution in to your file system. Suppose its located at C:\eclipsewtp. Next, you need to add WSO2WSAS plugins to wtp in ord

Using Apache Jmeter to test axis2 web services

I wrote a tutorial on apache JMeter and axis2 web services two months back and which was published in wso2.org . It describes the basic scenario of writing a Java service implementation class, Deploy it in a servlet container and send a soap request to the web service using JMeter and retrieving the response. Have a look!!