Oracle® Application Server
XML Java API Reference
10g Release 3 (10.1.3)

B28238-01


org.apache.soap.transport
Class TransportMessage

java.lang.Object
  extended byorg.apache.soap.transport.TransportMessage

All Implemented Interfaces:
java.io.Serializable

public class TransportMessage
extends java.lang.Object
implements java.io.Serializable

Transport type-independent encapsulation of SOAP message content.

See Also:
Serialized Form

Field Summary
protected byte[] bytes
protected java.lang.String contentType
protected SOAPContext ctx
protected java.lang.String envelope
protected java.util.Hashtable headers
protected int offset

Constructor Summary
TransportMessage()
No-argument constructor.
TransportMessage(java.io.InputStream is, int contentLength, java.lang.String contentType, SOAPContext ctx, java.util.Hashtable headers)
Create a message from an InputStream.
TransportMessage(java.lang.String envelope, SOAPContext ctx, java.util.Hashtable headers)
Create a message from an already built envelope and/or SOAPContext.

Method Summary
protected void editEnvelope(EnvelopeEditor editor, boolean isIncoming)
void editIncoming(EnvelopeEditor editor)
Apply envelope/root part editor on inbound message.
void editOutgoing(EnvelopeEditor editor)
Apply envelope/root part editor on outgoing message.
byte[] getBytes()
Get the response byte array.
int getContentLength()
Get size of response content in bytes.
java.lang.String getContentType()
Get Content-Type.
java.lang.String getEnvelope()
Get SOAP Envelope/root part as a String.
java.io.Reader getEnvelopeReader()
Get SOAP Envelope/root part as a Reader.
java.lang.String getHeader(java.lang.String name)
Get a transport header.
java.util.Enumeration getHeaderNames()
Get transport header names.
java.util.Hashtable getHeaders()
Get the complete header hashtable.
SOAPContext getSOAPContext()
Get SOAPContext.
java.lang.String read()
Interpret byte array and extract SOAPContext and SOAP envelope (as a String).
void readFully(java.io.InputStream is)
Set the byte array of the response.
void save()
Write message to byte array.
void setBytes(byte[] data)
Set the byte array of the response.
void setContentType(java.lang.String contentType)
Set Content-Type as String.
void setEnvelope(java.lang.String envelope)
Set SOAP Envelope.
void setHeader(java.lang.String name, java.lang.String value)
Set a transport header.
Envelope unmarshall(DocumentBuilder xdb)
Parse envelope.
void writeTo(java.io.OutputStream outStream)
Write content.

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

contentType

protected java.lang.String contentType

offset

protected int offset

bytes

protected byte[] bytes

envelope

protected java.lang.String envelope

headers

protected java.util.Hashtable headers

ctx

protected SOAPContext ctx

Constructor Detail

TransportMessage

public TransportMessage()
No-argument constructor.

TransportMessage

public TransportMessage(java.lang.String envelope,
                        SOAPContext ctx,
                        java.util.Hashtable headers)
                 throws java.lang.IllegalArgumentException,
                        MessagingException,
                        java.io.IOException,
                        SOAPException
Create a message from an already built envelope and/or SOAPContext. The envelope argument may be null. Call save() to generate the byte array.

TransportMessage

public TransportMessage(java.io.InputStream is,
                        int contentLength,
                        java.lang.String contentType,
                        SOAPContext ctx,
                        java.util.Hashtable headers)
                 throws java.lang.IllegalArgumentException,
                        MessagingException,
                        java.io.IOException,
                        SOAPException
Create a message from an InputStream. This reads the InputStream and stores it in a byte array. Call read() to extract the SOAPContext and SOAP envelope from the byte array.

Method Detail

editIncoming

public void editIncoming(EnvelopeEditor editor)
                  throws SOAPException,
                         java.io.IOException,
                         MessagingException
Apply envelope/root part editor on inbound message. Nothing will be done if the root part is not text. If it is, the Content-Type of the root part is preserved.
Throws:
SOAPException
java.io.IOException
MessagingException

editOutgoing

public void editOutgoing(EnvelopeEditor editor)
                  throws SOAPException,
                         java.io.IOException,
                         MessagingException
Apply envelope/root part editor on outgoing message. Nothing will be done if the root part is not text. If it is, the Content-Type of the root part is preserved.
Throws:
SOAPException
java.io.IOException
MessagingException

editEnvelope

protected void editEnvelope(EnvelopeEditor editor,
                            boolean isIncoming)
                     throws SOAPException,
                            java.io.IOException,
                            MessagingException
Throws:
SOAPException
java.io.IOException
MessagingException

read

public java.lang.String read()
                      throws java.lang.IllegalArgumentException,
                             MessagingException,
                             java.io.IOException,
                             SOAPException
Interpret byte array and extract SOAPContext and SOAP envelope (as a String). Make sure content type is set before calling this. Note that in the Messaging scenario, the root type is not necessarily a SOAP envelope, or even text. If it is text, the text is returned and it is up to the invoker to check the root part's Content-Type
Throws:
java.lang.IllegalArgumentException
MessagingException
java.io.IOException
SOAPException

unmarshall

public Envelope unmarshall(DocumentBuilder xdb)
                    throws SOAPException
Parse envelope.
Throws:
SOAPException

save

public void save()
          throws java.lang.IllegalArgumentException,
                 MessagingException,
                 java.io.IOException
Write message to byte array. Override this method for transport types that encode in a non-standard way.
Throws:
java.lang.IllegalArgumentException
MessagingException
java.io.IOException

getSOAPContext

public SOAPContext getSOAPContext()
Get SOAPContext.

getEnvelope

public java.lang.String getEnvelope()
                             throws MessagingException,
                                    java.io.IOException
Get SOAP Envelope/root part as a String. This method will extract the root part from the SOAPContext as a String if there is no SOAP Envelope.
Throws:
MessagingException
java.io.IOException

getEnvelopeReader

public java.io.Reader getEnvelopeReader()
                                 throws MessagingException,
                                        java.io.IOException
Get SOAP Envelope/root part as a Reader. Returns null if the root part is not text.
Throws:
MessagingException
java.io.IOException

setEnvelope

public void setEnvelope(java.lang.String envelope)
Set SOAP Envelope.

getContentType

public java.lang.String getContentType()
Get Content-Type.

setContentType

public void setContentType(java.lang.String contentType)
Set Content-Type as String.

getContentLength

public int getContentLength()
Get size of response content in bytes.

setHeader

public void setHeader(java.lang.String name,
                      java.lang.String value)
Set a transport header.

getHeader

public java.lang.String getHeader(java.lang.String name)
Get a transport header.

getHeaderNames

public java.util.Enumeration getHeaderNames()
Get transport header names.

getHeaders

public java.util.Hashtable getHeaders()
Get the complete header hashtable.

writeTo

public void writeTo(java.io.OutputStream outStream)
             throws java.io.IOException
Write content.
Throws:
java.io.IOException

setBytes

public void setBytes(byte[] data)
Set the byte array of the response.

readFully

public void readFully(java.io.InputStream is)
               throws java.io.IOException
Set the byte array of the response.
Throws:
java.io.IOException

getBytes

public byte[] getBytes()
Get the response byte array.

Oracle® Application Server
XML Java API Reference
10g Release 3 (10.1.3)

B28238-01


Copyright © 2001 The Apache Software Foundation. All rights reserved.