Before you start
This tutorial is a guide to the more advanced feature set of Apache Axis and its JAX-RPC capabilities. You'll learn how to autogenerate client programs from a Web Services Description Language (WSDL) file, making consumption of JAX-RPC services simple. You'll also learn how to deploy your Web service restrictively, limiting the methods and parameters available for other users to work with. Along the way, you'll gain a deeper and more thorough understanding of Apache Axis and how it configures, sends, and receives JAX-RPC requests and responses.
Most Java™-based Web services begin as stand-alone Java classes. Those classes are then converted to Web services, often simply by being dropped into an autodeploy directory in a Web service toolkit. However, in many cases it isn't appropriate to expose every method on a Java class as a Web service. By default, though, that's exactly what most Web service toolkits do: let the world use each and every public method in your Java class. This tutorial will help you learn not only how to specify which methods should be exposed — and which should not — but also how to make good decisions about what to expose.
WSDL has become the lingua franca of Web services. However, WSDL is extremely verbose, full of information that's marginally human-readable, and generally a pain to deal with. Fortunately, Web service toolkits like Apache Axis make it simple to feed a WSDL file to a command-line program or Java process and get a set of mostly usable autogenerated classes. You'll learn how to use Axis' code-generation utilities, as well as what you need to change in that generated code to get it working quickly and efficiently.
You'll also:
- Become familiar with the various command-line code-generation tools that Axis offers
- Learn how to construct Web services that protect both private and public methods from Web access
- See which Java idioms do not translate well to a Web service environment
This tutorial is a follow-on to "Build an RPC service and client using JAX-RPC." It is highly recommended that readers who are unfamiliar with JAX-RPC programming complete that tutorial before beginning this one. Regardless of your JAX-RPC experience, you'll find it easier to follow this tutorial if you work through that one first.
This tutorial is written for Java programmers. You should be comfortable coding Java applications and working with standard and third-party Java APIs and toolkits. You should be comfortable writing simple Web services and clients that consume them. You should also have deployed at least one Web service via dropping a Java class into Apache Axis' webapps/axis directory. This autodeployment feature is the basis of much of this tutorial's advanced discussion, so familiarity with that deployment mechanism is critical.
Basic familiarity with WSDL is helpful but not required. In fact, you can avoid many of the details surrounding WSDL by using the techniques detailed in this tutorial for code autogeneration.
You need a Web server that's capable of hosting server-side Java applications (servlets). You can use any Java-capable Web servlet container, application server, or hosting provider. One of the most popular solutions is Apache Tomcat, which is both free and well-documented. It's also up to you whether you test out your programs on a remote server (at your company or an ISP), or on your local machine. You just need to have the server installed and running on an accessible machine.
You should have Apache Axis installed and configured on your servlet engine/Web server. If you're unsure how to get Apache Axis running, you should refer to "Build an RPC service and client using JAX-RPC."


