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

4.3. Deploying the Service

Service deployment is not part of the SOAP specification, so each implementation has its own deployment procedure. We'll look at service deployment using two SOAP implementations: Apache SOAP and GLUE.

4.3.1. Deploying with Apache SOAP

In Apache SOAP, you must create a deployment descriptor, which is an XML file that contains information about the service and the Java class that implements the service. Let's take a look at a deployment descriptor for CallCounterService, implemented by the Java class javasoap.book.ch4.MethodCounter:

<isd:service 
   xmlns:isd="http://xml.apache.org/xml-soap/deployment"
   id="urn:CallCounterService">
   
   <isd:provider type="java"
         scope="Application"
         methods="doSomething getCount">
     <isd:java class="javasoap.book.ch4.MethodCounter"
         static="false"/>
   </isd:provider>
   <isd:faultListener>
   org.apache.soap.server.DOMFaultListener
   </isd:faultListener>
   <isd:mappings>
   </isd:mappings>    
</isd:service>

The outermost XML element is called service, which is namespace-qualified using the identifier isd, representing the http://xml.apache.org/xml-soap/deployment namespace. The service element also has an id attribute that is assigned the unique name of the service being deployed. I've prefixed the service name, CallCounterService, with urn. You don't need to do this, but it's a common practice that I'll follow, at least in this example. Just be aware that it's not a requirement.

The first child element is called provider , which describes ...

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