O'Reilly logo

Java and SOAP by Robert Englander

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9.6. Writing an Apache Axis Client

The Apache group is currently working on a completely new SOAP implementation known as Axis.[8] It's really too early in the evolution of that project to spend much time on it. It's likely to change quite a bit before it stabilizes, and right now it's not ready for production use. The plan is for Axis to conform to JAX-RPC, an emerging API standard for SOAP RPC. Nevertheless, Axis is out there now and can be used to experiment a bit. So let's take a brief look at Axis and get a feel for how it's likely to work. Later, in Chapter 11, we'll take a look at JAX-RPC.

[8] The actual name is currently being debated, but as of this writing it is still called Axis. The examples in this book are based on the Axis release dated December 5, 2001. Obviously, you can expect changes to the APIs as things develop.

The heart of the client is Axis2DotNet. It invokes the getHeadlines method on the .NET service that we used before.

package javasoap.book.ch9.clients; import org.apache.axis.AxisFault; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.apache.axis.client.Transport; import org.apache.axis.encoding.XMLType; import org.apache.axis.transport.http.HTTPConstants; import org.apache.axis.utils.Options; import java.net.URL; import java.util.*; public class Axis2DotNet { public static void main(String args[]) { try { URL url = new URL("http://mindstrm.com:8199/CorpDataService/Proxy.asmx"); Service service = new Service( ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required