The Server-Side Pad

by Fabien Tiburce, Best practices and personal experiences with enterprise software

SOAP – Apache Axis – Part 1

leave a comment »

Axis is Apache’s implementation of SOAP, an XML based object invocation protocol. While SOAP services have been around for some time, what strikes me is how easy and fast it has become to implement a web service using Axis. There are two methods of creating a web service in Axis. The first and by far the fastest is to rename the java “class” containing the business logic you wish to expose from .java to .jws and place this file in the root of the war file. This .jws will be compiled to a .class on first invocation much like .jsp pages are compiled into servlets. Invoking the .jws (programmatic post or even browser get), effectively routes the SOAP request to the SOAP servlet and runs the method specified as a parameter (?method=). That’s it! This is a fast and effective way of exposing a regular class and its methods as a web service. This also allows regular classes to be easily retrofitted/exposed as web services with very little effort. This approach does not yet permit the use of packages although directories are allowed. The second method involves writing a wsdl descriptor for the method which is more involved, more time consuming but arguably more flexible. However I find the ease and speed of the first approach too compelling to pass. In fact, I can’t think of a faster way of exposing business logic as a web service or remote procedure call. Why go with SOAP when you may have an in-house XML over HTTP framework already in place? Any custom solution requires routing and handling code which SOAP elegantly and transparently handles. SOAP and Apache Axis allow the developer to spend less time on the routing and handling of requests and more time focusing on the business logic.


Written by Compliantia

November 8, 2006 at 8:57 pm

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: