So How Do We Develop a SOAP Server?


This is eXtremely trivial!!!
There are only two steps involved:
  1. Write the code (service) as you would write any other standard java class with methods
  2. Deploy the service
For a closer look, let us consider a simple service that adds two numbers and returns the sum.
The java code would look as follows:

import java.io.*;

public class AddService 
{

  public int add(int num1, int num2) throws Exception 
  {
    return num1 + num2;
  }
  
}

It's that simple!
Now we need to deploy the service to expose the add method. For this, we need to define a deployment descriptor, which really is just an XML file. This is what the deployment descriptor looks like:
<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
             id="urn:xmltoday-add-numbers">
  <isd:provider type="java"
                scope="Application"
                methods="add">
    <isd:java class="AddService"/>
  </isd:provider>
  <isd:faultListener>org.apache.soap.server.DOMFaultListener
</isd:service>

The deployment tool of your toolkit will use this DeploymentDescriptor.xml to make your service available.

Next --> So How Do We Develop A SOAP Client??