public class BodyBlock extends java.lang.Object implements MustUnderstandFault
BodyBlock.getXMLNode()
method.
BodyBlocks always exist in pairs. Each request BodyBlock creates it's own response BodyBlock.
For each SOAPTransaction, the ApplicationConnectors have to create an ApplicationTransaction.
During the handling of each BodyBlock, the SOAPTransaction will ask each of the ApplicationTransactions if it can process the
BodyBlock, and if so, it will call the process()
method. So each BodyBlock will be processed within the context of an ApplicationTransaction.
If the ApplicationTransaction decides that the data in the BodyBlock causes the transaction to be aborted, it can return false
from the process()
method. Such an action usually is represented in the response SOAP Envelope by means of a SOAP Fault tag.
This tag can be created through the BodyBlock.createSOAPFault();
method.
The processing of a BodyBlock by the SOAP Processor happens in a synchronous manner. This means, that each BodyBlock is handled in the order in
which it appears in the SOAP Processor. However, in some cases, handling of a BodyBlock may be very expensive, and the ApplicationTransaction that
is processing the BodyBlock may decide to do this in an asynchronous manner, so that the SOAP Processor can continue handling the remaining BodyBlocks
(and even subsequent SOAP Envelopes). In order to do so, the ApplicationTransaction can call the BodyBlock.setAsync(true);
method.
In order to tell the SOAP Processor that it can continue with the SOAPTransaction after the ApplicationTransaction has completed handling of the BodyBlock,
the ApplicationTransaction can call the BodyBlock.continueTransaction();
method (or, in case of error, BodyBlock.abortTransaction();
).
Constructor and Description |
---|
BodyBlock(int node,
SOAPTransaction soapTransaction,
MethodDefinition definition) |
BodyBlock(int methodNode,
SOAPTransaction soapTransaction,
MethodDefinition definition,
int requestEnvelopeNode,
int responseEnvelopeNode) |
Modifier and Type | Method and Description |
---|---|
void |
abortTransaction()
Indicates to the SOAP Processor that it can abort the transaction
in which this body block is being handled, and can continue processing it by
sending the response back to the client.
|
void |
continueTransaction()
Indicates to the SOAP Processor that it can continue processing the transaction
in which this body block is being handled.
|
Fault |
createSOAPFault(javax.xml.namespace.QName faultCode,
IStringResource faultString,
java.lang.Object... arguments)
Creates the SOAP Fault and returns the soap fault object.
|
Fault |
createSOAPFault(javax.xml.namespace.QName faultCode,
java.lang.String faultActor,
IStringResource faultString,
java.lang.Object... arguments)
Creates the SOAP Fault and returns the soap fault object.
|
int |
createSOAPFault(java.lang.String faultCode,
java.lang.String faultString)
Deprecated.
use createSOAPFault(QName faultCode, IStringResource faultString, Object... arguments)
|
MethodDefinition |
getDefinition()
Deprecated.
since BCP 4.2
|
org.w3c.dom.Element |
getDOMElement() |
MethodDefinition |
getMethodDefinition()
Returns MethodDefinition object from Cache
|
Request |
getRequest()
Deprecated.
Use getSOAPTransaction instead
|
BodyBlock |
getRequestBodyBlock()
Returns the request body block.
|
BodyBlock |
getResponseBodyBlock()
Returns the response body block.
|
int |
getRootSOAPBodyNode() |
int |
getSOAPEnvelopeNode() |
Fault |
getSoapFault()
Returns the SOAP fault, if any.
|
java.lang.String |
getSoapPrefix()
Deprecated.
This method is not applicable any more, use XML NOM API to retreive the prefix of the SOAP Body node.
|
SOAPTransaction |
getSOAPTransaction()
Returns the SOAP Transaction in which this body block forms a part.
|
int |
getXMLNode()
Returns the xml node for this body block
|
boolean |
isAsync()
Returns whether or not the soap processor should handle this body block asynchronous.
|
boolean |
isPending()
Indicates that the ApplicationTransaction handling this body block has completed it's work,
either by having called the continueTransaction() or the abortTransaction() method.
|
boolean |
mustUnderstand()
Deprecated.
|
Fault |
raiseMustUnderstandFault(IStringResource faultString,
java.lang.Object... faultStringArgument)
Sets the fault to the user specified Fault.
|
void |
setAsync(boolean async)
Indicates that completion of handling of this body block
will be indicated by the application connector.
|
public BodyBlock(int methodNode, SOAPTransaction soapTransaction, MethodDefinition definition, int requestEnvelopeNode, int responseEnvelopeNode)
public BodyBlock(int node, SOAPTransaction soapTransaction, MethodDefinition definition)
public void setAsync(boolean async)
public boolean isAsync()
public void continueTransaction()
public void abortTransaction()
public boolean isPending()
public MethodDefinition getDefinition()
getMethodDefinition
public MethodDefinition getMethodDefinition()
public BodyBlock getRequestBodyBlock()
this
will be returned.public BodyBlock getResponseBodyBlock()
this
will be returned.public Request getRequest()
public SOAPTransaction getSOAPTransaction()
public int createSOAPFault(java.lang.String faultCode, java.lang.String faultString)
faultCode
- The text to be put in the %lt;SOAP:faultcode>faultString
- The text to be put in the %lt;SOAP:faultstring>public int getXMLNode()
public org.w3c.dom.Element getDOMElement()
public boolean mustUnderstand()
public Fault createSOAPFault(javax.xml.namespace.QName faultCode, IStringResource faultString, java.lang.Object... arguments)
faultCode
- The fault codefaultString
- The fault stringarguments
- The dynamic insertion arguments to be passed to the fault stringpublic Fault createSOAPFault(javax.xml.namespace.QName faultCode, java.lang.String faultActor, IStringResource faultString, java.lang.Object... arguments)
faultCode
- The fault codefaultActor
- The fault actorfaultString
- The fault stringarguments
- The dynamic insertion arguments to be passed to the fault stringpublic Fault raiseMustUnderstandFault(IStringResource faultString, java.lang.Object... faultStringArgument)
MustUnderstandFault
raiseMustUnderstandFault
in interface MustUnderstandFault
public java.lang.String getSoapPrefix()
public Fault getSoapFault()
public int getSOAPEnvelopeNode()
public int getRootSOAPBodyNode()