org.idoox.xmlrpc
Interface Message


Deprecated. See SOAPMessage and XMLInvocationHelper.

public interface Message

represents a generic XML-based message containing header(s) and body(ies)

Since:
4.0
Component:
Core

Field Summary
static int LOC_BODY
          Deprecated. Constant for accessing attributes/namespaces of SOAP body
static int LOC_ENVELOPE
          Deprecated. Constant for accessing attributes/namespaces of SOAP envelope
static int LOC_HEADER
          Deprecated. Constant for accessing attributes/namespaces of SOAP header
 
Method Summary
 void addHeader(QName headerName, java.util.Map properties, java.lang.String content)
          Deprecated. Adds header with given name and content at the end of the list of headers for this message instance.
 void addHeader(QName headerName, java.util.Map properties, java.lang.String content, int pos)
          Deprecated. Inserts header with given name and content at the given position in the list of headers for this message instance.
 void addHeader(QName headerName, java.util.Map properties, Tokenizer content)
          Deprecated. Use addHeader(Tokenizer content) instead.
 void addHeader(QName headerName, java.util.Map properties, Tokenizer content, int pos)
          Deprecated. Use addHeader(Tokenizer content, int pos) instead.
 void addHeader(Tokenizer content)
          Deprecated. Adds new header with given content.
 void addHeader(Tokenizer content, int pos)
          Deprecated. Adds new header with given content.
 MessagePart createBody()
          Deprecated.  
 MessagePart createBody(Tokenizer body)
          Deprecated. tokenizer containing the body of the message
 Fault createFault()
          Deprecated. Creates a new fault for this message.
 QName getAttrQNameEncodingStyle()
          Deprecated. Returns QName of the attribute encodingStyle
 QName getAttrQNameMustUnderstand()
          Deprecated. Returns QName of the attribute mustUnderstand
 QName getAttrQNameRole()
          Deprecated. Returns QName of the attribute role (actor in SOAP 1.1)
 MessagePart getBody()
          Deprecated. Returns the whole body.
 java.lang.String getElementAttribute(QName attributeName, int location)
          Deprecated. returns attribute defined on envelope, header or body element
 Fault getFault()
          Deprecated. Returns a fault contained in this message.
 Tokenizer getHeader(int pos)
          Deprecated. Returns header for given index.
 Tokenizer getHeader(QName headerName)
          Deprecated. Returns header with given header name or null if no such header found.
 MessagePart getHeaderAsPart(int pos)
          Deprecated. Returns header for given index.
 MessagePart getHeaderAsPart(QName headerName)
          Deprecated. Returns header for given name.
 java.lang.String getHeaderAsString(int pos)
          Deprecated. Returns header for given index.
 java.lang.String getHeaderAsString(QName headerName)
          Deprecated. Returns header for given name.
 int getHeaderCount()
          Deprecated. Returns number of headers for this message instance
 java.lang.String getNamespace(java.lang.String prefix, int location)
          Deprecated. returns namespace for a given prefix
 void initFault()
          Deprecated. use initFault(boolean needsBody) instead.
 void initFault(boolean needsBody)
          Deprecated. This method prepares the message instance for fault generation.
 void initInput()
          Deprecated. Prepares this Message instance for receiving of the input data.
 void initOutput()
          Deprecated. use initOutput(boolean needsBody) instead.
 void initOutput(boolean needsBody)
          Deprecated. This method prepares the message instance for reply generation.
 boolean isFault()
          Deprecated. returns whether this message contains SOAP Fault.
 void releaseMessagePart(MessagePart part)
          Deprecated. called when the message part is no longer used
 void removeHeader(int pos)
          Deprecated. Removes header on given position from the list of headers for this message instance.
 void removeHeader(QName headerName)
          Deprecated. Removes header with given name from the list of headers for this instance.
 void send()
          Deprecated. creates a transport output stream (if not already created) and writes out the message.
 void setElementAttribute(QName attributeName, java.lang.String attributeValue, int location)
          Deprecated. sets attribute on envelope, header or body element
 void setNamespace(java.lang.String prefix, java.lang.String namespace, int location)
          Deprecated. sets namespace-prefix binding
 

Field Detail

LOC_ENVELOPE

public static final int LOC_ENVELOPE
Deprecated. 
Constant for accessing attributes/namespaces of SOAP envelope

See Also:
Constant Field Values

LOC_HEADER

public static final int LOC_HEADER
Deprecated. 
Constant for accessing attributes/namespaces of SOAP header

See Also:
Constant Field Values

LOC_BODY

public static final int LOC_BODY
Deprecated. 
Constant for accessing attributes/namespaces of SOAP body

See Also:
Constant Field Values
Method Detail

getHeaderCount

public int getHeaderCount()
Deprecated. 
Returns number of headers for this message instance

Returns:
headers count for this instance

getHeader

public Tokenizer getHeader(int pos)
Deprecated. 
Returns header for given index. Content of the header is represented by the Tokenizer interface instance, which is initially in the START_TOKEN state

This method cannot be combined with getHeaderAsString methods, because those methods, except the internal XML Tokenizer, will be in initial state.

Parameters:
pos - the position of the header
Returns:
the header

getHeader

public Tokenizer getHeader(QName headerName)
                    throws MultipleHeadersException
Deprecated. 
Returns header with given header name or null if no such header found.

This method cannot be combined with getHeaderAsString methods, because those methods, except the internal XML Tokenizer, will be in initial state.

Parameters:
headerName - name of the header
Returns:
the header
Throws:
MultipleHeadersException - if multiple headers have given name

getHeaderAsPart

public MessagePart getHeaderAsPart(int pos)
Deprecated. 
Returns header for given index. Content of the header is represented by the MessagePart interface instance.

Parameters:
pos - position of the part
Returns:
the part of the header

getHeaderAsPart

public MessagePart getHeaderAsPart(QName headerName)
                            throws MultipleHeadersException
Deprecated. 
Returns header for given name. Content of the header is represented by the MessagePart interface instance.

Parameters:
headerName - name of the header
Returns:
the part representing the header or null if not found
Throws:
MultipleHeadersException - if more than one header with the same QName has been found

getHeaderAsString

public java.lang.String getHeaderAsString(int pos)
                                   throws MessageProcessingException
Deprecated. 
Returns header for given index. The returned string contains content of the header or null when no content is present or the header contains subelements.

This method cannot be combined with getHeader methods, because it changes state of the internal XML Tokenizer.

The header is removed from the list of headers for this message instance, so it cannot be retrieved again using any getHeader method.

Parameters:
pos - index of the header
Returns:
content of the given header if present, null otherwise.
Throws:
MessageProcessingException - if the content of the header is not one string

getHeaderAsString

public java.lang.String getHeaderAsString(QName headerName)
                                   throws MessageProcessingException,
                                          MultipleHeadersException
Deprecated. 
Returns header for given name. The returned string contains content of the header or null when no content is present or the header contains subelements.

This method cannot be combined with getHeader methods, because it changes state of the internal XML Tokenizer.

The header is removed from the list of headers for this message instance, so it cannot be retrieved again using any getHeader method.

Parameters:
headerName - name of the header
Returns:
content of the given header if present, null otherwise.
Throws:
MultipleHeadersException - if more than one header with the same QName has been found
MessageProcessingException - if the content of the header is not one string

addHeader

public void addHeader(Tokenizer content)
               throws TokenizerException,
                      java.io.IOException,
                      MessageProcessingException
Deprecated. 
Adds new header with given content. The content tokenizer defines header content including the root element of the header and its attributes (e.g. mustUnderstand, actor, etc.)

Parameters:
content - content of the header to be added including the header's root element with attributes
Throws:
TokenizerException
java.io.IOException
MessageProcessingException

addHeader

public void addHeader(Tokenizer content,
                      int pos)
               throws TokenizerException,
                      java.io.IOException,
                      MessageProcessingException
Deprecated. 
Adds new header with given content. The content tokenizer defines header content including the root element of the header and its attributes (e.g. mustUnderstand, actor, etc.)

Parameters:
content - content of the header to be added including the header's root element with attributes.
pos - position of the header in the message counting from 0.
Throws:
TokenizerException
java.io.IOException
MessageProcessingException

addHeader

public void addHeader(QName headerName,
                      java.util.Map properties,
                      Tokenizer content)
               throws java.io.IOException
Deprecated. Use addHeader(Tokenizer content) instead.

Adds header with given name and content to the list of headers for this message instance.

The content Tokenizer must be in the START_TOKEN or CONTENT state.

Parameters:
headerName - fully qualified name of the header
properties - additional properties (e.g. mustUnderstand, actor, etc.) - see Constants interface It can be null when no additional properties for the header are needed.
content - The Tokenizer interface instance representing content of the header, can be null when the header has no content
Throws:
java.io.IOException - if there was io error

addHeader

public void addHeader(QName headerName,
                      java.util.Map properties,
                      Tokenizer content,
                      int pos)
               throws java.io.IOException
Deprecated. Use addHeader(Tokenizer content, int pos) instead.

Inserts header with given name and content on given position to the list of headers for this message instance

The content Tokenizer must be in the START_TOKEN or CONTENT state.

Parameters:
headerName - fully qualified name of the header
properties - additional properties (e.g. mustUnderstand, actor, etc.) - see Constants interface. It can be null when no additional properties for the header are needed.
content - The Tokenizer interface instance representing content of the header, can be null when the header has no content
pos - position, where the header should placed in the message
Throws:
java.io.IOException - if there was io error

addHeader

public void addHeader(QName headerName,
                      java.util.Map properties,
                      java.lang.String content)
               throws java.io.IOException
Deprecated. 
Adds header with given name and content at the end of the list of headers for this message instance.

The content is represented by java.lang.String instance and is stored in the header as a content for the header element.

Parameters:
headerName - fully qualified name of the header
properties - additional properties (e.g. mustUnderstand, actor, etc.) - see Constants interface. It can be null when no additional properties for the header are needed.
content - The java.lang.String instance representing content of the header, can be null when the header has no content
Throws:
java.io.IOException - if there was io error

addHeader

public void addHeader(QName headerName,
                      java.util.Map properties,
                      java.lang.String content,
                      int pos)
               throws java.io.IOException
Deprecated. 
Inserts header with given name and content at the given position in the list of headers for this message instance.

The content is represented by java.lang.String instance and is stored in the header as a content for the header element.

Parameters:
headerName - fully qualified name of the header
properties - additional properties (e.g. mustUnderstand, actor, etc.) - see Constants interface. It can be null when no additional properties for the header are needed.
content - The java.lang.String instance representing content of the header, can be null when the header has no content
pos - position, where the header should placed in the message
Throws:
java.io.IOException - if there was an io error

removeHeader

public void removeHeader(int pos)
Deprecated. 
Removes header on given position from the list of headers for this message instance.

Parameters:
pos - position of the header

removeHeader

public void removeHeader(QName headerName)
                  throws MultipleHeadersException
Deprecated. 
Removes header with given name from the list of headers for this instance.

Parameters:
headerName - name of the header
Throws:
MultipleHeadersException - if multiple headers have given name

getBody

public MessagePart getBody()
                    throws MessageProcessingException
Deprecated. 
Returns the whole body. If this call is used in the header processors, the caller: Otherwise, the body is consumed and deserialization afterwards will throw an exception (illegal state).

Returns:
the 'Body' part of the SOAP message
Throws:
MessageProcessingException - if there an error getting/parsing the body of the SOAP Message

initInput

public void initInput()
               throws java.io.IOException,
                      MessageProcessingException
Deprecated. 
Prepares this Message instance for receiving of the input data. It parses all headers from the incoming connection and positions itself on the first tag after Body envelope tag.

Throws:
java.io.IOException - if there is an io error
MessageProcessingException - if the message is malformed

initOutput

public void initOutput()
                throws java.io.IOException
Deprecated. use initOutput(boolean needsBody) instead.

This method prepares the message instance for reply generation.

It needs to be called whenever the message instance is shared for both request and reply. It must be called after the runtime finishes processing of the request because after this method, the request is no longer available in the message.

Throws:
java.io.IOException - if there is an io error

initOutput

public void initOutput(boolean needsBody)
                throws java.io.IOException
Deprecated. 
This method prepares the message instance for reply generation.

It needs to be called whenever the message instance is shared for both request and reply. It must be called after the runtime finishes processing of the request because after this method, the request is no longer available in the message.

Parameters:
needsBody - if true, the message will cache all TokenWriter calls done on the body part to allow further reading and modification by header processors using Tokenizer interface.
Throws:
java.io.IOException - if there is an io error

initFault

public void initFault()
               throws java.io.IOException
Deprecated. use initFault(boolean needsBody) instead.

This method prepares the message instance for fault generation.

It needs to be called whenever the message instance is shared for both request and reply. It must be called after the runtime finishes processing of the request because after this method, the request is no longer available in the message.

Throws:
java.io.IOException - if there is an io error

initFault

public void initFault(boolean needsBody)
               throws java.io.IOException
Deprecated. 
This method prepares the message instance for fault generation.

It needs to be called whenever the message instance is shared for both request and reply. It must be called after the runtime finishes processing of the request because after this method, the request is no longer available in the message.

Parameters:
needsBody - if true, the message will cache all TokenWriter calls done on the body part to allow further reading and modification by header processors using Tokenizer interface.
Throws:
java.io.IOException - if there is an io error

createBody

public MessagePart createBody()
                       throws java.io.IOException
Deprecated. 
Throws:
java.io.IOException

createBody

public MessagePart createBody(Tokenizer body)
                       throws TokenizerException,
                              java.io.IOException,
                              MessageProcessingException
Deprecated. 
tokenizer containing the body of the message

Parameters:
body -
Throws:
TokenizerException
java.io.IOException
MessageProcessingException

send

public void send()
          throws java.io.IOException
Deprecated. 
creates a transport output stream (if not already created) and writes out the message.

This method must be called, otherwise the message will not be send over the transport connection.

Throws:
java.io.IOException - if there is an io error

getFault

public Fault getFault()
               throws MessageProcessingException
Deprecated. 
Returns a fault contained in this message. (Used for incoming messages)

The returned fault instance can be read using methods of the Fault interface.

Returns:
the fault
Throws:
MessageProcessingException - if the message is malformed

isFault

public boolean isFault()
                throws MessageProcessingException
Deprecated. 
returns whether this message contains SOAP Fault.

Returns:
true if the message contains SOAP Fault, false otherwise
Throws:
MessageProcessingException - if the message is malformed

createFault

public Fault createFault()
                  throws java.io.IOException
Deprecated. 
Creates a new fault for this message. (Used for outgoing messages)

The returned fault instance should be filled using methods on the Fault interface and then send() method on the message must be called for the message with fault to be sent.

Returns:
the created fault
Throws:
java.io.IOException - if there was io error

getElementAttribute

public java.lang.String getElementAttribute(QName attributeName,
                                            int location)
Deprecated. 
returns attribute defined on envelope, header or body element

Parameters:
attributeName - the name of the attribute
location - the location of the attribute (one of LOC_XXX constants)
Returns:
the attribute or null if not found

setElementAttribute

public void setElementAttribute(QName attributeName,
                                java.lang.String attributeValue,
                                int location)
Deprecated. 
sets attribute on envelope, header or body element

Parameters:
attributeName - the name of the attribute
attributeValue - the value of the attribute
location - the location of the attribute (one of LOC_XXX constants)

getNamespace

public java.lang.String getNamespace(java.lang.String prefix,
                                     int location)
Deprecated. 
returns namespace for a given prefix

Parameters:
prefix - the prefix for which namespace should be returned
location - the location where the prefix should be resolved (one of LOC_XXX constants)
Returns:
resolved namespace or null if there is no such prefix binding defined

setNamespace

public void setNamespace(java.lang.String prefix,
                         java.lang.String namespace,
                         int location)
Deprecated. 
sets namespace-prefix binding

Parameters:
prefix - the prefix that should be bound to the namespace
namespace - the namespace to be bound
location - the location where the prefix should be generated (one of LOC_XXX constants)

releaseMessagePart

public void releaseMessagePart(MessagePart part)
Deprecated. 
called when the message part is no longer used


getAttrQNameEncodingStyle

public QName getAttrQNameEncodingStyle()
Deprecated. 
Returns QName of the attribute encodingStyle

Returns:
QName of the attribute encodingStyle

getAttrQNameMustUnderstand

public QName getAttrQNameMustUnderstand()
Deprecated. 
Returns QName of the attribute mustUnderstand

Returns:
QName of the attribute mustUnderstand

getAttrQNameRole

public QName getAttrQNameRole()
Deprecated. 
Returns QName of the attribute role (actor in SOAP 1.1)

Returns:
QName of the attribute role (actor in SOAP 1.1)