jimm.twice.ice.xml
Class SoapEnvelope

java.lang.Object
  extended byjimm.twice.ice.xml.SoapEnvelope

public class SoapEnvelope
extends java.lang.Object

ICE messages are delivered inside SOAP envelopes. The SOAP header contains an ICE message header and the body contains delivery, subscribe, and fault messages.

To retrieve a SOAP envelope as XML call toString.

Author:
Jim Menard, jimm@io.com
See Also:
MessageHeader, Delivery, Subscribe, Fault

Field Summary
protected  Node bodyNode
           
protected  Document document
           
protected  Node headerNode
           
 
Constructor Summary
SoapEnvelope()
          Creates an empty SOAP envelope.
SoapEnvelope(Header header)
          Creates a SOAP envelope containing a header and an empty body.
SoapEnvelope(Header header, Message body)
          Creates a SOAP envelope containing an ICE message.
SoapEnvelope(IceMachine sender)
          Creates a SOAP envelope containing a header and an empty body.
SoapEnvelope(IceMachine sender, Message body)
          Creates a SOAP envelope containing a header and body.
 
Method Summary
 boolean containsFault()
           
 Node getBodyNode()
           
 Node getHeaderNode()
           
 Tag getHeaderTag()
           
 Message setBody(Message msg)
           
 Header setHeader(Header header)
           
 java.lang.String toString()
          Returns the XML representation of the payload.
 void writeTo(java.io.OutputStream out)
          Writes the payload to a writer stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

document

protected Document document

headerNode

protected Node headerNode

bodyNode

protected Node bodyNode
Constructor Detail

SoapEnvelope

public SoapEnvelope()
Creates an empty SOAP envelope.


SoapEnvelope

public SoapEnvelope(IceMachine sender)
Creates a SOAP envelope containing a header and an empty body.

Parameters:
sender - the ICE machine sending the message

SoapEnvelope

public SoapEnvelope(IceMachine sender,
                    Message body)
Creates a SOAP envelope containing a header and body.

Parameters:
sender - the ICE machine sending the message
body - the body

SoapEnvelope

public SoapEnvelope(Header header)
Creates a SOAP envelope containing a header and an empty body.

Parameters:
header - the header

SoapEnvelope

public SoapEnvelope(Header header,
                    Message body)
Creates a SOAP envelope containing an ICE message.

Parameters:
header - the header
body - the body
Method Detail

containsFault

public boolean containsFault()

getHeaderTag

public Tag getHeaderTag()

getHeaderNode

public Node getHeaderNode()

getBodyNode

public Node getBodyNode()

setHeader

public Header setHeader(Header header)

setBody

public Message setBody(Message msg)

writeTo

public void writeTo(java.io.OutputStream out)
             throws java.io.IOException
Writes the payload to a writer stream.

Parameters:
out - the output writer
Throws:
java.io.IOException

toString

public java.lang.String toString()
Returns the XML representation of the payload.

Returns:
an XML string