net.sf.xbus.protocol.soap
Class SOAPMessage

java.lang.Object
  extended by net.sf.xbus.protocol.Message
      extended by net.sf.xbus.protocol.xml.XMLMessageAbstract
          extended by net.sf.xbus.protocol.soap.SOAPMessage
All Implemented Interfaces:
ObjectMessage, TextMessage, XMLMessage

public class SOAPMessage
extends XMLMessageAbstract
implements TextMessage, ObjectMessage

SOAPMessage represents messages for the Simple Object Access Protocol.


Field Summary
static java.lang.String SOAP_BODY
           
static java.lang.String SOAP_DETAIL
           
static java.lang.String SOAP_FAULT
           
static java.lang.String SOAP_FAULTCODE
           
static java.lang.String SOAP_NAMESPACE
           
static java.lang.String SOAPENV_QUALIFIER
           
 
Constructor Summary
SOAPMessage(java.lang.String function, XBUSSystem source, java.lang.String id)
          This constructor initializes the new SOAPMessage with the given parameters.
SOAPMessage(XBUSSystem source)
          This constructor stores the source, creates an unique identifier for the message and initializes the requestTimestamp.
 
Method Summary
 org.w3c.dom.Document getTemplateAsDocument()
          Returns a W3C document containing an empty SOAPMessage
static java.lang.String getTemplateAsString()
          Returns a XML string containing an empty SOAPMessage
 void setErrortext(java.lang.String text)
          Sets the errortext with the given String.
protected  void synchronizeRequestFields(XBUSSystem system)
          After setting the request data, both setRequestText and setRequestDocument, the function of the Message must be set.
protected  void synchronizeResponseFields(XBUSSystem system)
          After setting the response data, both setResponseText and setResponseDocument, some fields of the Message must be synchronized with the response data.
 
Methods inherited from class net.sf.xbus.protocol.xml.XMLMessageAbstract
getDocumentBuilder, getRequestDocument, getRequestObject, getRequestText, getResponseDocument, getResponseObject, getResponseText, parseXML, serializeXML, setRequestDocument, setRequestObject, setRequestText, setResponseDocument, setResponseObject, setResponseText
 
Methods inherited from class net.sf.xbus.protocol.Message
getErrorcode, getErrortext, getFunction, getId, getRequestTimestamp, getResponseTimestamp, getReturncode, getShortname, getSource, setErrorcode, setFunction, setId, setResponseTimestamp, setReturncode, setShortname
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.xbus.protocol.TextMessage
getRequestText, getResponseText, setRequestText, setResponseText
 
Methods inherited from interface net.sf.xbus.protocol.ObjectMessage
getRequestObject, getResponseObject, setRequestObject, setResponseObject
 

Field Detail

SOAP_DETAIL

public static final java.lang.String SOAP_DETAIL
See Also:
Constant Field Values

SOAP_FAULTCODE

public static final java.lang.String SOAP_FAULTCODE
See Also:
Constant Field Values

SOAP_FAULT

public static final java.lang.String SOAP_FAULT
See Also:
Constant Field Values

SOAP_BODY

public static final java.lang.String SOAP_BODY
See Also:
Constant Field Values

SOAP_NAMESPACE

public static final java.lang.String SOAP_NAMESPACE
See Also:
Constant Field Values

SOAPENV_QUALIFIER

public static final java.lang.String SOAPENV_QUALIFIER
See Also:
Constant Field Values
Constructor Detail

SOAPMessage

public SOAPMessage(XBUSSystem source)
This constructor stores the source, creates an unique identifier for the message and initializes the requestTimestamp. It is used when constructing a new SOAPMessage from the data of a receiver.


SOAPMessage

public SOAPMessage(java.lang.String function,
                   XBUSSystem source,
                   java.lang.String id)
This constructor initializes the new SOAPMessage with the given parameters. It is used when constructing a new SOAPMessage by converting it from another Message.

Method Detail

setErrortext

public void setErrortext(java.lang.String text)
Sets the errortext with the given String. Additionally, a Fault element is added to the SOAP message, if there is not already one.

Overrides:
setErrortext in class Message

synchronizeRequestFields

protected void synchronizeRequestFields(XBUSSystem system)
                                 throws XException
After setting the request data, both setRequestText and setRequestDocument, the function of the Message must be set. The name of the first element of the SOAP body is used as the function.

Specified by:
synchronizeRequestFields in class XMLMessageAbstract
Throws:
XException

synchronizeResponseFields

protected void synchronizeResponseFields(XBUSSystem system)
                                  throws XException
After setting the response data, both setResponseText and setResponseDocument, some fields of the Message must be synchronized with the response data. When an error has occured within the called system, a Fault element must be included in the response. In this case, the returncode will be set to RC_NOK and the errortext will be the concatination of faultcode and faultstring.

Specified by:
synchronizeResponseFields in class XMLMessageAbstract
Throws:
XException

getTemplateAsDocument

public org.w3c.dom.Document getTemplateAsDocument()
                                           throws XException
Returns a W3C document containing an empty SOAPMessage

Throws:
XException

getTemplateAsString

public static java.lang.String getTemplateAsString()
                                            throws XException
Returns a XML string containing an empty SOAPMessage

Throws:
XException