What is Axis?
Axis is an implementation of the Simple
Object Access Protocol: SOAP. SOAP is meant for exchanging data in a
distributed environment, and SOAP is built on XML. There are several
implementations of SOAP, and one of the best known is Apache SOAP, which currently has reached
version 2.2. Axis is also made by the Apache project, but it's not part
of the Apache SOAP project. Axis is a completely new rewrite with emphasis on
flexibility and performance. You could think of Axis as SOAP version 3. Axis has
been underway for a long time, but on March 15th this year the first beta
version was announced. It's this version that is the background for my article.
You may read more about the Axis
project on their web site.
Installing Axis
The new beta version can be downloaded as a zip file from this address. There's a lot of
very good documentation in the zip file, and a good place to start is the
Release Notes file, which gives some of the reasons for using Axis instead of
Apache SOAP 2.2. To install Axis find the install.html file and go through the
installation instructions. The important points in this are:
- copy the webapps/axis directory to your servers webapps directory. I'd
recommend using a Tomcat server for the first installation, because Tomcat is
so simple to install. The axis directory is where we deployed our jws-file in
the start of the article.
- copy an XML parser (e.g. the Apache Xerces parser) to the
lib directory in the axis/Web-inf directory. All other jar files already exist
in this directory.
- start your web server
To see if the Axis servlet is alive you may simply try to enter:
http://localhost:8080/axis/servlet/AxisServlet
in your browser. This should produce the text "Hi there, this is an AXIS
service!".
Axis comes with an excellent User's Guide which I recommend reading. There's
no reason for me to duplicate what's already in the guide, so below I'll give
you some more examples for inspiration and I'll also try to promote some of the
useful utilities in Axis.
There are several small Axis clients in the samples directory. To run these
clients you'll have to add all the 7 jar-files from the Axis lib-directory plus
the XML parser jar-file to your classpath. Then try: >java samples.userguide.example1.TestClient
which should reply: Sent 'Hello!', got 'Hello!'
Not much SOAP to see, right? But I'll soon put a magnifying glass on the wire
to show you what's going on there.
SOAP and Web Services
As I mentioned we'll think of web services as a client and a server program
exchanging SOAP formatted messages over the Internet (or an intranet). From this
definition you can also see that there is no new magic in web services. It's
simply an agreement on using a specific data format on the web. What makes Web
Services interesting is the fact that SOAP is not bound to a specific
platform--Microsoft and Java applications can actually talk to each other. But
you should be prepared for surprises. SOAP and Web Services are far from being
finally standardized, and currently the many software vendors have different
views on the preliminary specifications. If you select SOAP for your application
in order to be able to communicate with other companies' SOAP systems, then be
sure to allocate time for testing.
But still, any attempt to try to standardize formats for data exchange should
be welcomed, and the SOAP format is flexible enough to accept not only simple
data types like strings and integers but also arrays, collections and even
beans.
Writing a program that takes some data, formats it as a SOAP message using
basic API's and finally sends it to a server is not very interesting to most
programmers. And the reverse operation: receiving the SOAP message and
extracting the data in it is just as boring. It's a pure technical thing and has
nothing to do with business programming. The good thing is that Axis does all
the technical stuff for us. If you're interested in what the SOAP messages look
like when they flow between the client and the server, you'll appreciate a nice
utility that comes with Axis.
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.
|