Chapter 14. SOAP and XOE SOAP server

Table of Contents
SOAP
XOE SOAP Server

The XOE SOAP Service (XOE package name soap) allows an application builder to communicate with other networked applications exposed by a SOAP Server. This service is also able to act as a lightweight (i.e. incomplete) SOAP Server with the help of the XOE package named "simple-soap-server." The "simple-soap-server" XOE package is an extension of the SOAP service that allows a XOE framework to listen for incoming soap requests.

SOAP

Dependencies

The soap package depends on the mime package.


	 mime
	 ^
	 |
	 soap
      

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." It has been tested with the Apache SOAP project version 2.2. It is doubtful that Microsoft .NET services can be accessed with the XOE SOAP Service at this time.

Assumptions

This document assumes that the reader understands the following specifications:

Table 14-1.

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

API

In order to make a SOAP request, a developer will need four pieces of information:

  1. A SOAP Service Name, also known as the URI (Universal Resource Identifier)

  2. The Method Name the developer wishes to access on the remote SOAP Service

  3. A list of parameter objects contained in the form of a java.util.Stack object

  4. The URL of the remote Soap Server

There are two optional parameters that can be passed to a Soap request:

  1. A java.util.Vector can be passed as a way of receiving a collection of objects from the remote method.

Architecture

The SOAP Service is dependent on the MIME package. This allows SOAP messages to send and receive files as MIME attachments. This adds great potential and convenience for future file sharing applications and the handling of email attachments. Currently, this feature is used exclusively with the XOE Sync Service.

The architechture of the SOAP Service can be divided into three parts:

  1. The SOAP Message

  2. The SOAP Document

  3. The SOAP Parameter

         
	 StringSoapParameter
	 IntegerSoapParameter
	 LongSoapParameter
	 ContentElementSoapParameter
	 PackageQuerySoapParameter
	 VectorSoapParameter
	 XElementSoapParameter
	 ExceptionSoapParameter
      

If a developer needs to access a SOAP service method that contains a parameter that is not a String, Integer, Long, ContentElement, PackageQuery, Vector, XElement or Exception, a new SoapParameter added to the package is all that needs to be done. The SoapParameterFactory will find it through reflection, as long as the name of the class begins with the EXACT name of the parameter object.

Leftovers

All constants used for creating and parsing Soap Messages can be found in SoapConstants. All exceptions thrown while creating and parsing Soap Messages are caught and rethrown as SoapServiceExceptions.