Posts

Showing posts from June, 2009

Publishing Simple Java class as Web Service using Axis

Image
In Previous post on Axis ( http://ydtech.blogspot.com/2009/06/deploying-apache-axis-to-oracle-oc4j.html ), I have explained how to deploy Axis as a Web Application. Now its time to utilize Axis web service framework. Apache Axis provides a very simple way of publishing any simple java class as Web Service. This post explains it in simple steps. 1. Code your service implementation as a Simple java class. For this example we take example of simple String Conversation Service( lower case to upper case). This is only for demo purpose. Now Our pojo java class would be public class StrConvService {     public StrConvService() {     }     public String invoke(String str){         return str.toUpperCase();     } } 2. Name this file as StrConvService.jws and copy it to <OC4J_Home>/jdev/home/application/<Axis_WebApp_Home>/<webapp> 3. Got to http://localhost:8888/axis-webapp/StrConvService.jws   4. Click on WSDL link on

Deploying Apache Axis to Oracle OC4J Application Server

Image
            Apache Axis is a framework processing SOAP message. It gives a very flexible ways of handling SOAP message. It provides very convenient  ways of creating and invoking web services. You can leave overhead of handling SOAP message to axis framework.  Axis is installed as Web Module in any application server, this web module will acts as wrapper Web Service for your simple pojo java classes. Any simple java class will get converted to web service using this Axis Web module. This tutorial explain deploying Axis to OC4j application server. 1. First download Axis archive from http://people.apache.org/dist/axis/nightly/ . 2. Extract the zip file. 3. to deploy Axis as Web App to OC4j , we need to create archive file (war) and then deploy through console. So to create a war file go to command prompt and go to <asxis_home>/webapps/axis/ 4. execute the command    jar –cvf axis-webapp.war .   This command will create axis-webapp.war file in current directory. 5.Now go

HTTP 1.0 to HTTP 1.1

A major improvement in the HTTP 1.1 standard is persistent connections. In HTTP 1.0, a connection between a Web client and server is closed after a single request/response cycle. In HTTP 1.1, a connection is kept alive and reused for multiple requests. Persistent connections reduce communication lag perceptibly, because the client doesn't need to renegotiate the TCP connection after each request.

REST vs SOAP based Web Services

Another Web service approach is getting popular i.e. REST based services. REST stands for Representational State Transfer. Representational state transfer (REST) is a style of software architecture for distributed hypermedia systems such as the World Wide Web. In REST-full web services, the emphasis is on simple point-to-point communication over HTTP using plain old XML(POX). But architects and developers need to decide when this particular style is an appropriate choice for their applications. A RESTFul design may be appropriate when The web services are completely stateless. A caching infrastructure can be leveraged for performance. If the data that the web service returns is not dynamically generated and can be cached, then the caching infrastructure that web servers and other intermediaries inherently provide can be leveraged to improve performance. However, the developer must take care because such caches are limited to the HTTP GETmethod for most servers. The service produc