XOE SOAP Server

The XOE Lightweight Simple Soap Server (XOE package name "simple-soap-server") is an extension of the SOAP service that allows a XOE framework to listen for incoming soap requests.

Dependencies

The simple-soap-server package depends on both the mime package and the soap package.


	 --->mime
	 |    ^
	 soap  |
	 ^     |
	 |     |
	 simple-soap-server
      

The mime package is not a service. It is a collection of objects that can parse inputstreams into mime attachments. For more information, please refer to the javadocs for org.xoe.mime.

Compliance

The XOE SOAP Service complies with "SOAP Version 1.1" specification as well as "SOAP Messages with Attachments."

Assumptions

This document assumes that the reader understands the following specifications:

Table 14-2.

W3C SOAP Version 1.1http://www.w3.org/TR/SOAP
W3C SOAP Messages with Attachmentshttp://www.w3.org/TR/SOAP-attachments
Apache SOAP projecthttp://xml.apache.org/soap/index.html

Stand Alone Mode

The Lightweight Soap Server can be run as a XOE application or as a Stand Alone Server. "Stand Alone" is a bit of a misnomer. What "Stand Alone" really means is that the Soap Server can be configured from outside the XOE package. The server is a XOE application regardless of whether it is run in Stand Alone Mode or not. But XOE applications are designed to not save information to the file system by default. So if a developer wished to run a Lightweight Soap Server as a desktop machine application, this would be more easily done by running it in Stand Alone Mode.

Architecture

The SimpleSoapServer should be accessed through it's interface, ISimpleSoapServer. All the necessary methods to administer the server are provided on this interface. Services provided by the server are held in the SimpleSoapServerRegistry, which is essentially a hash of services and their unique identifiers. The networking layer of the server is handled by the SimpleSoapServerRegistry.

API

ISimpleSoapServer contains the following methods. Access to these methods are all that a developer should need to administer a Soap Server on a XOE device:

  1. listen()

  2. shutdown()

  3. getCurrentPort()

  4. isRunning()

  5. registerService()

  6. lookupService()

  7. getServiceTable()

  8. getStandAloneMode()

  9. getStandAloneWorkingDir()

GUI and Services

The Lightweight Soap Server package comes with a simple XOE application that provides a front end gui to admister the server. Currently there is no interactive way to add services to the server. If a developer wants to add a service to the Soap Server, the following steps need to be taken:

  1. Add a class to your package that implements org.xoe.core.packages.InstallScript

  2. Inside the postInstall() method add the following code:

    
		  ISimpleSoapServer ssServer;
    		  ssServer = (ISimpleSoapServer) ServiceLocator.findImplementor (ISimpleSoapServer.INTERFACE);
    		  
    		  MyNewSoapService myNewSoapService = new MyNewSoapService ();
    		  ssServer.registerService ( myNewSoapService.SERVICE_ID, myNewSoapService);
    	       

  3. Add a file called scripts.xml and put it in the resource folder of your package. Inside the file, add the following xml:

    
		  <custom-script>my.package.MyNewSoapService</custom-script>
    	       

When XOE boots up, MyNewSoapPackage will be automatically installed and registered with the SimpleSoapServer. For an example of this functionality, take a look at the sync-server XOE package.