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.messaging
Class Message

    java.lang.Object
      |
      +--org.apache.soap.messaging.Message

public class Message
extends java.lang.Object

A `Message` is the class whose instances represent one-way messages in SOAP. While messages are one-way, they are sometimes carried on two-way transports such as HTTP. To accomodate that, the API supported here has a "receive" method as well - that is only applicable if the transport that is being used supports the receive() method (@see org.apache.soap.transport.SOAPTransport) so that this API can get at the 'response' envelope.

Constructor Summary
`Message()`

Method Summary
`void` | `addBodyPart(MimeBodyPart part)` Add a MIME BodyPart to the request MIME envelope.
`MimeBodyPart` | `findBodyPart(java.lang.String uri)` Find the MIME part referred to by the given URI in the response MIME envelope.
`MimeBodyPart` | `getBodyPart(int index)` Get the specified Part in the reponse MIME envelope by its index.
`int` | `getPartCount()` Return the number of enclosed BodyPart objects in the response MIME envelope.
`SOAPContext` | `getRequestSOAPContext()` Get the request SOAPContext.
`SOAPContext` | `getResponseSOAPContext()` Get the response SOAPContext.
`MimeBodyPart` | `getRootPart()` Get the root Part of the reponse MIME envelope, or the only part if the response wasn't multipart.
`SOAPTransport` | `getSOAPTransport()`
`DataHandler` | `receive()` Receive a response from the given transport.
`Envelope` | `receiveEnvelope()` Receive an envelope from the given transport.
`void` | `send(java.net.URL url, java.lang.String actionURI, Envelope env)` Send an envelope to the given URL via the SOAPTransport that has been configured for this instance (or SOAPHTTPConnection by default).
`void` | `setSOAPTransport(SOAPTransport st)`

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

Constructor Detail

### Message

    public Message()

Method Detail

### setSOAPTransport

    public void setSOAPTransport(SOAPTransport st)

### getSOAPTransport

    public SOAPTransport getSOAPTransport()

### send

    public void send(java.net.URL url,
                     java.lang.String actionURI,
    Envelope env)
              throws SOAPException

  Send an envelope to the given URL via the SOAPTransport that has been configured for this instance (or SOAPHTTPConnection by default). The envelope is sent exactly as-is.
  Parameters:
    `url` - the url to send to
    `actionURI` - the value of the SOAPAction header
    `env` - envelope to send
  Throws:
    `SOAPException` - if something goes wrong.

### receiveEnvelope

    public Envelope receiveEnvelope()
                             throws SOAPException

  Receive an envelope from the given transport. Only applicable where the transport supports the receive method. If the (root part of) the response does not have text/xml as the Content-Type, null will be returned. If the response is not a SOAP envelope, receive() should be used instead.
  Returns:
    the envelope received
  Throws:
    `SOAPException` - if something goes wrong
  See Also:
    `receive()`

### receive

    public DataHandler receive()
                        throws SOAPException,
                               MessagingException

  Receive a response from the given transport. Only applicable where the transport supports the receive method.
  Returns:
    the root part of the response as a DataHandler
  Throws:
    `SOAPException` - if something goes wrong
    `MessagingException`
  See Also:
    `receive()`

### getRequestSOAPContext

    public SOAPContext getRequestSOAPContext()

  Get the request SOAPContext.
  Returns:
    SOAPContext

### addBodyPart

    public void addBodyPart(MimeBodyPart part)
                     throws MessagingException

  Add a MIME BodyPart to the request MIME envelope.
  Parameters:
    `part` - The Part to be appended
  Throws:
    `MessagingException`

### getResponseSOAPContext

    public SOAPContext getResponseSOAPContext()

  Get the response SOAPContext.
  Returns:
    SOAPContext

### findBodyPart

    public MimeBodyPart findBodyPart(java.lang.String uri)

  Find the MIME part referred to by the given URI in the response MIME envelope. This can be:
  - An absolute URI, in which case a part is located with a corresponding Content-Location header.
  - A relative URI, in which case an absolute URI is constructed relative to the Content-Location header of the root SOAP part or the multipart and the previous rule is then applied.
  - A URI of the format "cid:xxx"> in which case a part is located with a matching Content-ID header.
  Returns null if the part is not found.

  Note: relative URIs not entirely implemented yet.

  Parameters:
    `uri` - the URI
  Returns:
    the Part or null if not found

### getPartCount

    public int getPartCount()
                     throws MessagingException

  Return the number of enclosed BodyPart objects in the response MIME envelope.
  Returns:
    number of parts
  Throws:
    `MessagingException`

### getBodyPart

    public MimeBodyPart getBodyPart(int index)
                             throws java.lang.IndexOutOfBoundsException

  Get the specified Part in the reponse MIME envelope by its index. Parts are numbered starting at 0.
  Parameters:
    `index` - the index of the desired Part
  Returns:
    the Part
  Throws:
    `java.lang.IndexOutOfBoundsException` - if no such Part exists

### getRootPart

    public MimeBodyPart getRootPart()
                             throws MessagingException

  Get the root Part of the reponse MIME envelope, or the only part if the response wasn't multipart.
  Returns:
    the Part
    `MessagingException`

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.