The Apache SOAP Routing Service

Before moving on to the rest of the examples, we need to make a quick note about Apache SOAP’s routing and service capability. It’s a concept that is likely to be applicable to other SOAP infrastructures you may use in the future. If you have poked around with Apache (or you looked ahead at the rest of the chapter), you may have noticed that many samples use a common URL, which either looks like http://localhost:8080/soap/servlet/messagerouter or http://localhost:8080/soap/servlet/rpcrouter. These special URLs point to Apache’s routing and dispatching mechanism. This mechanism looks at the content of the SOAP envelope and decides which class to load and which method to call within that class. Apache refers to this destination as a service . The service is registered with the servlet engine in a two-step process. First, an XML deployment descriptor is created, specifying details about the class name of the service, its associated method call, and the target URI. Then a special org.apache.soap.server.ServiceManagerClient class is invoked to register the service with Apache SOAP.

Using the RPC router, any Java class and method can be registered as a service; the Apache SOAP infrastructure will call the method with the appropriate parameters. An example of SOAP-RPC can be found in Chapter 4. Using the message router, the method name is the tag name of the body entry in the SOAP envelope, and the method always conforms to the following signature:

public ...

Get Java Web Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.