org.infolayer.soap.util
Class SoapInboundMessageImpl

java.lang.Object
  extended byorg.infolayer.soap.util.SoapInboundMessageImpl
All Implemented Interfaces:
SoapInboundMessage

public class SoapInboundMessageImpl
extends java.lang.Object
implements SoapInboundMessage

A simple class for handling inbound multipart SOAP messages on J2SE.

Author:
J�rg Pleumann

Constructor Summary
SoapInboundMessageImpl()
          Creates a new message object.
 
Method Summary
 void decode(java.io.InputStream input, java.lang.String contentType)
          Decodes and initializes the object.
 java.io.InputStream getAttachment(java.lang.String key)
          Returns an InputStream to a single attachment by its key.
 java.util.Enumeration getAttachments()
          Returns an enumeration holding the keys for all the attachments of the SOAP request.
 java.lang.String getAttachmentType(java.lang.String key)
          Returns the MIME type of a single attachment by its key.
 XmlPullParser getBody()
          Returns an XML parser for the body of the SOAP request.
 java.lang.String getLogin()
          Returns the remote user's login.
 java.lang.String getPassword()
          Returns the remote user's password.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoapInboundMessageImpl

public SoapInboundMessageImpl()
Creates a new message object.

Method Detail

getLogin

public java.lang.String getLogin()
Returns the remote user's login.

Specified by:
getLogin in interface SoapInboundMessage

getPassword

public java.lang.String getPassword()
Returns the remote user's password.

Specified by:
getPassword in interface SoapInboundMessage

getBody

public XmlPullParser getBody()
                      throws XmlPullParserException
Returns an XML parser for the body of the SOAP request. The first token will be the start tag of the first XML element after the SOAP body element itself.

Specified by:
getBody in interface SoapInboundMessage
Throws:
XmlPullParserException

getAttachments

public java.util.Enumeration getAttachments()
Returns an enumeration holding the keys for all the attachments of the SOAP request. The keys are actually string, but the Enumeration doesn't know about that. Maybe a String array would be a better return type?

Specified by:
getAttachments in interface SoapInboundMessage

getAttachment

public java.io.InputStream getAttachment(java.lang.String key)
                                  throws java.io.IOException
Returns an InputStream to a single attachment by its key.

Specified by:
getAttachment in interface SoapInboundMessage
Throws:
java.io.IOException

getAttachmentType

public java.lang.String getAttachmentType(java.lang.String key)
Returns the MIME type of a single attachment by its key.

Specified by:
getAttachmentType in interface SoapInboundMessage

decode

public void decode(java.io.InputStream input,
                   java.lang.String contentType)
            throws java.io.IOException,
                   XmlPullParserException
Decodes and initializes the object. The InputStream holds the - possibly multipart - SOAP request in its transmission form. The content type is needed to know in advance whether the InputStream holds multipart data or not. Both parameters should suffice to decode a SOAP request regardless of the way it has been transmitted. Thus we are not bound to an HTTP request and do not have a dependency to the servlet API.

Specified by:
decode in interface SoapInboundMessage
Throws:
java.io.IOException
XmlPullParserException