public interface SoapBody extends SoapElement
Body
element in a SOAP message. A SOAP body contains the payload of the
message. This payload can be custom XML, or a SoapFault
(but not both).
Note that the source returned by getSource()
includes the SOAP Body element itself. For the contents of
the body, use getPayloadSource()
.
SoapEnvelope.getBody()
,
getPayloadSource()
,
getPayloadResult()
,
SoapFault
Modifier and Type | Method and Description |
---|---|
SoapFault |
addClientOrSenderFault(String faultStringOrReason,
Locale locale)
Adds a
Client /Sender fault to the body. |
SoapFault |
addMustUnderstandFault(String faultStringOrReason,
Locale locale)
Adds a
MustUnderstand fault to the body. |
SoapFault |
addServerOrReceiverFault(String faultStringOrReason,
Locale locale)
Adds a
Server /Receiver fault to the body. |
SoapFault |
addVersionMismatchFault(String faultStringOrReason,
Locale locale)
Adds a
VersionMismatch fault to the body. |
SoapFault |
getFault()
Returns the
SoapFault of this body. |
Result |
getPayloadResult()
Returns a
Result that represents the contents of the body. |
Source |
getPayloadSource()
Returns a
Source that represents the contents of the body. |
boolean |
hasFault()
Indicates whether this body has a
SoapFault . |
addAttribute, addNamespaceDeclaration, getAllAttributes, getAttributeValue, getName, getSource, removeAttribute
Source getPayloadSource()
Source
that represents the contents of the body.WebServiceMessage.getPayloadSource()
Result getPayloadResult()
Result
that represents the contents of the body.
Calling this method removes the current content of the body.
WebServiceMessage.getPayloadResult()
SoapFault addMustUnderstandFault(String faultStringOrReason, Locale locale) throws SoapFaultException
MustUnderstand
fault to the body. A MustUnderstand
is returned when a SOAP
header with a MustUnderstand
attribute is not understood.
Adding a fault removes the current content of the body.
faultStringOrReason
- the SOAP 1.1 fault string or SOAP 1.2 reason textlocale
- the language of faultStringOrReason. Optional for SOAP 1.1SoapFault
SoapFaultException
SoapFault addClientOrSenderFault(String faultStringOrReason, Locale locale) throws SoapFaultException
Client
/Sender
fault to the body. For SOAP 1.1, this adds a fault with a
Client
fault code. For SOAP 1.2, this adds a fault with a Sender
code.
Adding a fault removes the current content of the body.
faultStringOrReason
- the SOAP 1.1 fault string or SOAP 1.2 reason textlocale
- the language of faultStringOrReason. Optional for SOAP 1.1SoapFault
SoapFaultException
SoapFault addServerOrReceiverFault(String faultStringOrReason, Locale locale) throws SoapFaultException
Server
/Receiver
fault to the body. For SOAP 1.1, this adds a fault with a
Server
fault code. For SOAP 1.2, this adds a fault with a Receiver
code.
Adding a fault removes the current content of the body.
faultStringOrReason
- the SOAP 1.1 fault string or SOAP 1.2 reason textlocale
- the language of faultStringOrReason. Optional for SOAP 1.1SoapFault
SoapFaultException
SoapFault addVersionMismatchFault(String faultStringOrReason, Locale locale) throws SoapFaultException
VersionMismatch
fault to the body.
Adding a fault removes the current content of the body.
faultStringOrReason
- the SOAP 1.1 fault string or SOAP 1.2 reason textlocale
- the language of faultStringOrReason. Optional for SOAP 1.1SoapFault
SoapFaultException
boolean hasFault()
SoapFault
.true
if the body has a fault; false
otherwiseSoapFault getFault()
SoapFault
of this body.SoapFault
, or null
if none is presentCopyright © 2020 Pivotal Software. All rights reserved.