Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle® Application Server XML Java API Reference 10g Release 2 (10.1.2) Part no. B12024-03 September 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.soap.transport
Class TransportMessage

    java.lang.Object
      |
      +--org.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.
    `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.
    `SOAPException`
    `java.io.IOException`
    `MessagingException`

### editEnvelope

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

    `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
    `java.lang.IllegalArgumentException`
    `MessagingException`
    `java.io.IOException`
    `SOAPException`

### unmarshall

    public Envelope unmarshall(DocumentBuilder xdb)
                        throws SOAPException

  Parse envelope.
    `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.
    `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.
    `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.
    `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.
    `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.
    `java.io.IOException`

### getBytes

    public byte[] getBytes()

  Get the response byte array.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle® Application Server XML Java API Reference 10g Release 2 (10.1.2) Part no. B12024-03 September 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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