org.jibx.soap
Class SOAPContext

java.lang.Object
  extended byorg.jibx.soap.SOAPContext
All Implemented Interfaces:
IMessageContext

public class SOAPContext
extends java.lang.Object
implements IMessageContext

SOAP message context. This allows both generating and processing SOAP messages.


Field Summary
static java.lang.String FAULTACTOR_NAME
           
static java.lang.String FAULTCODE_NAME
           
static java.lang.String FAULTDETAIL_NAME
           
static java.lang.String FAULTSTRING_NAME
           
static java.lang.String MUSTUNDERSTAND_NAME
           
static java.lang.String SOAP_BODYNAME
           
static java.lang.String SOAP_ENVNAME
           
static java.lang.String SOAP_FAULTNAME
           
static java.lang.String SOAP_HEADERNAME
           
static java.lang.String SOAP_PREFIX
           
static java.lang.String[] SOAP_PREFIX_ARRAY
           
static java.lang.String SOAP_URI
           
static java.lang.String[] SOAP_URI_ARRAY
           
 
Constructor Summary
SOAPContext(org.jibx.runtime.IBindingFactory fact, int indent)
          Create mapper from binding factory.
 
Method Summary
 SOAPFault getFaultResponse()
          Gets the unmarshalled fault response from a receive message.
 java.util.ArrayList getReceiveHeaders()
          Gets the list of received message header objects.
 java.lang.Object getReceivePayload()
          Gets the unmarshalled payload object from the body context of the receive message.
 java.util.ArrayList getSendHeaders()
          Gets the list of send message header objects.
 boolean isInbound()
          Check if in inbound processing.
 void marshalSOAP(java.io.OutputStream os)
          Marshal SOAP output message to stream.
 void setFaultResponse(SOAPFault fault)
          Sets a fault response to be sent back from a receive message.
 void setHeaderUnderstood(java.lang.Object header)
          Reports that a header has been understood and processed.
 void setSendPayload(java.lang.Object obj)
          Sets the payload object to be marshalled as the body content for the send message.
 void unmarshalSOAP(java.io.InputStream is)
          Unmarshal SOAP input message from stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOAP_URI

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

SOAP_URI_ARRAY

public static final java.lang.String[] SOAP_URI_ARRAY

SOAP_PREFIX

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

SOAP_PREFIX_ARRAY

public static final java.lang.String[] SOAP_PREFIX_ARRAY

SOAP_ENVNAME

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

SOAP_HEADERNAME

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

SOAP_BODYNAME

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

SOAP_FAULTNAME

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

FAULTCODE_NAME

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

FAULTSTRING_NAME

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

FAULTACTOR_NAME

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

FAULTDETAIL_NAME

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

MUSTUNDERSTAND_NAME

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

SOAPContext

public SOAPContext(org.jibx.runtime.IBindingFactory fact,
                   int indent)
            throws org.jibx.runtime.JiBXException
Create mapper from binding factory. This defines a mapper using the supplied binding factory for marshalling and unmarshalling message objects.

Parameters:
fact - binding factory defining mappings to and from XML
indent - number of spaces to indent for marshalling output
Throws:
org.jibx.runtime.JiBXException - on configuration or initialization error
Method Detail

marshalSOAP

public void marshalSOAP(java.io.OutputStream os)
                 throws SOAPException
Marshal SOAP output message to stream. This marshals the previously- configured headers and message body to the supplied stream. TODO: Add option for accumulating entire body in case of marshalling exception? It's not clear how useful this would be.

Parameters:
os - output stream to receive message
Throws:
SOAPException - on error in marshalling

unmarshalSOAP

public void unmarshalSOAP(java.io.InputStream is)
                   throws SOAPException
Unmarshal SOAP input message from stream. This unmarshals the SOAP headers and message body from the supplied stream.

Parameters:
is - input stream sourcing message
Throws:
SOAPException - on error in unmarshalling

setHeaderUnderstood

public void setHeaderUnderstood(java.lang.Object header)
Description copied from interface: IMessageContext
Reports that a header has been understood and processed.

Specified by:
setHeaderUnderstood in interface IMessageContext
Parameters:
header - understood header object

isInbound

public boolean isInbound()
Description copied from interface: IMessageContext
Check if in inbound processing.

Specified by:
isInbound in interface IMessageContext
Returns:
true if in inbound processing (before or during processing of message body object), false if in output processing (after processing of message body object)

getReceivePayload

public java.lang.Object getReceivePayload()
                                   throws SOAPException
Description copied from interface: IMessageContext
Gets the unmarshalled payload object from the body context of the receive message.

Specified by:
getReceivePayload in interface IMessageContext
Returns:
unmarshalled body object
Throws:
SOAPException - on error in getting the body object

setSendPayload

public void setSendPayload(java.lang.Object obj)
                    throws SOAPException
Description copied from interface: IMessageContext
Sets the payload object to be marshalled as the body content for the send message.

Specified by:
setSendPayload in interface IMessageContext
Parameters:
obj - payload object to be marshalled
Throws:
SOAPException - on error in setting the send payload object

getReceiveHeaders

public java.util.ArrayList getReceiveHeaders()
Description copied from interface: IMessageContext
Gets the list of received message header objects.

Specified by:
getReceiveHeaders in interface IMessageContext
Returns:
message header object list

getSendHeaders

public java.util.ArrayList getSendHeaders()
Description copied from interface: IMessageContext
Gets the list of send message header objects.

Specified by:
getSendHeaders in interface IMessageContext
Returns:
message header object list

setFaultResponse

public void setFaultResponse(SOAPFault fault)
Description copied from interface: IMessageContext
Sets a fault response to be sent back from a receive message.

Specified by:
setFaultResponse in interface IMessageContext
Parameters:
fault - response to be set

getFaultResponse

public SOAPFault getFaultResponse()
Description copied from interface: IMessageContext
Gets the unmarshalled fault response from a receive message.

Specified by:
getFaultResponse in interface IMessageContext
Returns:
fault response received


Project Web Site