org.infolayer.soap.util
Class SoapOutboundMessageImpl

java.lang.Object
  extended byorg.infolayer.soap.util.SoapOutboundMessageImpl
All Implemented Interfaces:
SoapOutboundMessage

public class SoapOutboundMessageImpl
extends java.lang.Object
implements SoapOutboundMessage

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

Author:
J�rg Pleumann

Constructor Summary
SoapOutboundMessageImpl()
          Creates a new message object.
 
Method Summary
 java.lang.String addAttachment(java.io.InputStream stream, java.lang.String contentType)
          Adds an attachment to this SOAP message and returns the access key for it.
 void encode(java.io.OutputStream output)
          Encodes the whole SOAP request plus all attachments into one - possibly multipart - SOAP request.
 XmlSerializer getBody()
          Returns an XML serializer for writing the body part of this SOAP message.
 java.lang.String getContentType()
          Returns the content type of this message.
 void setAuthentication(java.lang.String login, java.lang.String password)
          Sets the login and password to use during the authentication phase of the SOAP request.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoapOutboundMessageImpl

public SoapOutboundMessageImpl()
Creates a new message object.

Method Detail

setAuthentication

public void setAuthentication(java.lang.String login,
                              java.lang.String password)
                       throws java.io.IOException
Sets the login and password to use during the authentication phase of the SOAP request. Must be specified before anything is written to the body, that is, before the getBody() method ist called.

Specified by:
setAuthentication in interface SoapOutboundMessage
Throws:
java.io.IOException

getContentType

public java.lang.String getContentType()
Returns the content type of this message. The content type is required when actually transmitting the message over some other protocol, for example HTTP. In the latter case, it can be copied directly into the HTTP request object.

Specified by:
getContentType in interface SoapOutboundMessage

getBody

public XmlSerializer getBody()
                      throws java.io.IOException
Returns an XML serializer for writing the body part of this SOAP message. When called for the first time, the serializer has just written the start tag of the SOAP body element.

Specified by:
getBody in interface SoapOutboundMessage
Throws:
java.io.IOException

addAttachment

public java.lang.String addAttachment(java.io.InputStream stream,
                                      java.lang.String contentType)
Adds an attachment to this SOAP message and returns the access key for it.

Specified by:
addAttachment in interface SoapOutboundMessage

encode

public void encode(java.io.OutputStream output)
            throws java.io.IOException
Encodes the whole SOAP request plus all attachments into one - possibly multipart - SOAP request.

Specified by:
encode in interface SoapOutboundMessage
Throws:
java.io.IOException