Wed May 07 16:23:46 2003

Notes on configuring the OpenSPML SOAP router.

You must have a J2EE application server such as Tomcat, WebLogic, or
WebSphere.

There must be at least one application deployed in this server.  It
doesn't matter what the applications do, we will be using one of them
just to expose a new servlet.

Select an application deployed in the server, edit the web.xml file
found in the WEB-INF directory.  Add the following servlet
declaration:

  <servlet>
    <servlet-name>spmlrouter</servlet-name>
    <display-name>OpenSPML SOAP Router</display-name>
    <description>no description</description>
    <servlet-class>
        org.openspml.server.SOAPRouter
    </servlet-class>
    <init-param>
      <param-name>spmlHandler</param-name>
      <param-value>org.openspml.test.TestSpmlHandler</param-value>
    </init-param>
  </servlet>

Change org.openspml.test.TestSpmlHandler in the previous example to
the path of your class.  Your class must implement the
org.openspml.server.SpmlHandler interface.

Put the openspml.jar file and the jar file containing your SpmlHandler
class in the WEB-INF/lib directory of the application.  If you would
rather use individual .class files rather than a jar, place all of
them under the WEB-INF/classes directory.

This should be all the configuration you need.  You must restart the
application server if it was running.

The URL for the SPML service will now be of the form:

  http://<host>/<application>/servlet/spmlrouter

where <host> is replaced with your application server host name and
port and <application> is replaced with the name of the deployed
application whose web.xml file was modified.

You should now be able to use the SpmlClient class to communicate with
your SpmlHandler class.  For example:


    SpmlClient client = new SpmlClient();
    client.setUrl("http://localhost/lighthouse/servlet/spmlrouter");
    client.setTrace(true);

    AddRequest req = new AddRequest();
    req.setIdentifier("spmltest");
    req.setObjectClass("user");
    req.setAttribute("password", "xyzzy");
    req.setAttribute("email", "spmltest@anywhere.com");
    req.setAttribute("firstname", "Spml");
    req.setAttribute("lastname", "Test");

    AddResponse response = (AddResponse)client.request(req);

