Name

SOAPBody

Synopsis

public interface SOAPBody extends SOAPElement {
// Public Instance Methods
    public abstract SOAPBodyElement addBodyElement(Name name) 
        throws SOAPException; 
    public abstract SOAPFault addFault(  ) throws SOAPException; 
    public abstract SOAPFault getFault(  ); 
    public abstract boolean hasFault(  ); 
}

SOAPBody is a subinterface of SOAPElement that represents the body of a SOAP message. A single SOAPBody element will always be found as either the first or second element of the SOAPEnvelope, depending on whether the enclosing message has associated headers.

A SOAPBody element may contain any number of SOAPBodyElements that represent the information to be sent to the message recipient. These elements can be created and added to the body in a single operation by calling addBodyElement( ) or the addChildElement( ) method inherited from SOAPElement. SOAPElements obtained from a SOAPFactory or from the SOAPElementFactory class may also be added to the message body. However, in this case, since every immediate child of SOAPBody must be a SOAPBodyElement, a copy of the element (and any child elements it may contain) is made in which the original element is replaced by a SOAPBodyElement, and the copied hierarchy is added to the message body.

SOAPBody may also contain a single SOAPFault element if the message is reporting an error encountered while processing the headers or body of an earlier message. The addFault( ) method creates and adds a SOAPFault element to the message body. ...

Get Java Web Services in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.