org.apache.axis.message

Class SOAPBody

Implemented Interfaces:
Cloneable, org.w3c.dom.Element, Node, org.w3c.dom.NodeList, Serializable, SOAPBody, SOAPElement

public class SOAPBody
extends MessageElement
implements SOAPBody

Holder for body elements.
Author:
Glyn Normington (glyn@apache.org)

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.axis.message.MessageElement

MessageElement.QNameAttr

Field Summary

Fields inherited from class org.apache.axis.message.MessageElement

_isRoot, context, encodingStyle, endEventIndex, fixupDeserializer, href, id, log, message, namespaces, qNameAttrs, recorder, startContentsIndex, startEventIndex, typeQName

Fields inherited from class org.apache.axis.message.NodeImpl

_isDirty, attributes, children, document, log, name, namespaceURI, parent, prefix, textRep

Constructor Summary

SOAPBody(String namespace, String localPart, String prefix, Attributes attributes, DeserializationContext context, SOAPConstants soapConsts)

Method Summary

SOAPBodyElement
addBodyElement(Name name)
Creates a new SOAPBodyElement object with the specified name and adds it to this SOAPBody object.
void
addChild(MessageElement element)
SOAPElement
addChildElement(String localName)
Creates a new SOAPElement object initialized with the given String object and adds the new element to this SOAPElement object.
SOAPElement
addChildElement(String localName, String prefix)
Creates a new SOAPElement object initialized with the specified local name and prefix and adds the new element to this SOAPElement object.
SOAPElement
addChildElement(String localName, String prefix, String uri)
Creates a new SOAPElement object initialized with the specified local name, prefix, and URI and adds the new element to this SOAPElement object.
SOAPElement
addChildElement(Name name)
Creates a new SOAPElement object initialized with the given Name object and adds the new element to this SOAPElement object.
SOAPElement
addChildElement(SOAPElement element)
Add a SOAPElement as a child of this SOAPElement instance.
SOAPBodyElement
addDocument(Document document)
Adds the root node of the DOM Document to this SOAPBody object.
SOAPFault
addFault()
Creates a new SOAPFault object and adds it to this SOAPBody object.
SOAPFault
addFault(Name name, String s)
Creates a new SOAPFault object and adds it to this SOAPBody object.
SOAPFault
addFault(Name name, String s, Locale locale)
Creates a new SOAPFault object and adds it to this SOAPBody object.
void
disableFormatting()
SOAPFault
getFault()
Returns the SOAPFault object in this SOAPBody object.
boolean
hasFault()
Indicates whether a SOAPFault object exists in this SOAPBody object.
protected void
outputImpl(SerializationContext context)
void
setEncodingStyle(String encodingStyle)
Sets the encoding style for this SOAPElement object to one specified.
void
setParentElement(SOAPElement parent)
Sets the parent of this Node object to the given SOAPElement object.
void
setSAAJEncodingCompliance(boolean comply)

Methods inherited from class org.apache.axis.message.MessageElement

addAttribute, addAttribute, addAttribute, addAttribute, addChild, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addMapping, addNamespaceDeclaration, addTextNode, childDeepCloned, cloneNode, cloning, detachAllChildren, equals, findElement, getAllAttributes, getAsDOM, getAsDocument, getAsString, getAttribute, getAttributeNS, getAttributeNode, getAttributeNodeNS, getAttributeValue, getAttributeValue, getAttributesEx, getChildElement, getChildElements, getChildElements, getChildElements, getChildren, getCompleteAttributes, getDeserializationContext, getElementName, getElementsByTagName, getElementsByTagNameNS, getElementsNS, getEncodingStyle, getEnvelope, getFixupDeserializer, getHref, getID, getLength, getName, getNamespacePrefixes, getNamespaceURI, getObjectValue, getObjectValue, getOwnerDocument, getPrefix, getQName, getRealElement, getRecorder, getTagName, getType, getValue, getValueAsType, getValueAsType, getValueDOM, getVisibleNamespacePrefixes, hasAttribute, hasAttributeNS, isRoot, item, output, outputImpl, publishContents, publishToHandler, removeAttribute, removeAttribute, removeAttributeNS, removeAttributeNode, removeContents, removeNamespaceDeclaration, setAllAttributes, setAttribute, setAttribute, setAttributeNS, setAttributeNode, setAttributeNodeNS, setContentsIndex, setEncodingStyle, setEndIndex, setEnvelope, setFixupDeserializer, setNSMappings, setName, setNamespaceURI, setObjectValue, setQName, setRecorder, setType, setValue, toString

Methods inherited from class org.apache.axis.message.NodeImpl

appendChild, cloneNode, compareDocumentPosition, convertAttrSAXtoDOM, detachNode, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParent, getParentElement, getParentNode, getPrefix, getPreviousSibling, getSchemaTypeInfo, getTextContent, getUserData, getValue, hasAttributes, hasChildNodes, initializeChildren, insertBefore, isDefaultNamespace, isDirty, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, makeAttributesEditable, normalize, output, recycleNode, removeChild, replaceChild, reset, setDirty, setDirty, setIdAttribute, setIdAttributeNS, setIdAttributeNode, setNodeValue, setOwnerDocument, setParent, setParentElement, setPrefix, setTextContent, setUserData, setValue

Constructor Details

SOAPBody

public SOAPBody(String namespace,
                String localPart,
                String prefix,
                Attributes attributes,
                DeserializationContext context,
                SOAPConstants soapConsts)
            throws AxisFault

Method Details

addBodyElement

public SOAPBodyElement addBodyElement(Name name)
            throws SOAPException
Creates a new SOAPBodyElement object with the specified name and adds it to this SOAPBody object.
Specified by:
addBodyElement in interface SOAPBody
Parameters:
name - a Name object with the name for the new SOAPBodyElement object
Returns:
the new SOAPBodyElement object
Throws:
SOAPException - if a SOAP error occurs

addChild

public void addChild(MessageElement element)
            throws SOAPException
Overrides:
addChild in interface MessageElement

addChildElement

public SOAPElement addChildElement(String localName)
            throws SOAPException
Creates a new SOAPElement object initialized with the given String object and adds the new element to this SOAPElement object.
Specified by:
addChildElement in interface SOAPElement
Overrides:
addChildElement in interface MessageElement
Parameters:
localName - a String giving the local name for the element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object

addChildElement

public SOAPElement addChildElement(String localName,
                                   String prefix)
            throws SOAPException
Creates a new SOAPElement object initialized with the specified local name and prefix and adds the new element to this SOAPElement object.
Specified by:
addChildElement in interface SOAPElement
Overrides:
addChildElement in interface MessageElement
Parameters:
localName - a String giving the local name for the new element
prefix - a String giving the namespace prefix for the new element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object

addChildElement

public SOAPElement addChildElement(String localName,
                                   String prefix,
                                   String uri)
            throws SOAPException
Creates a new SOAPElement object initialized with the specified local name, prefix, and URI and adds the new element to this SOAPElement object.
Specified by:
addChildElement in interface SOAPElement
Overrides:
addChildElement in interface MessageElement
Parameters:
localName - a String giving the local name for the new element
prefix - a String giving the namespace prefix for the new element
uri - a String giving the URI of the namespace to which the new element belongs
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object

addChildElement

public SOAPElement addChildElement(Name name)
            throws SOAPException
Creates a new SOAPElement object initialized with the given Name object and adds the new element to this SOAPElement object.
Specified by:
addChildElement in interface SOAPElement
Overrides:
addChildElement in interface MessageElement
Parameters:
name - a Name object with the XML name for the new element
Returns:
the new SOAPElement object that was created
Throws:
SOAPException - if there is an error in creating the SOAPElement object

addChildElement

public SOAPElement addChildElement(SOAPElement element)
            throws SOAPException
Add a SOAPElement as a child of this SOAPElement instance. The SOAPElement is expected to be created by a SOAPElementFactory. Callers should not rely on the element instance being added as is into the XML tree. Implementations could end up copying the content of the SOAPElement passed into an instance of a different SOAPElement implementation. For instance if addChildElement() is called on a SOAPHeader, element will be copied into an instance of a SOAPHeaderElement.

The fragment rooted in element is either added as a whole or not at all, if there was an error.

The fragment rooted in element cannot contain elements named "Envelope", "Header" or "Body" and in the SOAP namespace. Any namespace prefixes present in the fragment should be fully resolved using appropriate namespace declarations within the fragment itself.

Specified by:
addChildElement in interface SOAPElement
Overrides:
addChildElement in interface MessageElement
Parameters:
element - the SOAPElement to be added as a new child
Returns:
an instance representing the new SOAP element that was actually added to the tree.
Throws:
SOAPException - if there was an error in adding this element as a child

addDocument

public SOAPBodyElement addDocument(Document document)
            throws SOAPException
Adds the root node of the DOM Document to this SOAPBody object.

Calling this method invalidates the document parameter. The client application should discard all references to this Document and its contents upon calling addDocument. The behavior of an application that continues to use such references is undefined.

Specified by:
addDocument in interface SOAPBody
Parameters:
document - the Document object whose root node will be added to this SOAPBody
Returns:
the SOAPBodyElement that represents the root node that was added
Throws:
SOAPException - if the Document cannot be added

addFault

public SOAPFault addFault()
            throws SOAPException
Creates a new SOAPFault object and adds it to this SOAPBody object.
Specified by:
addFault in interface SOAPBody
Returns:
the new SOAPFault object
Throws:
SOAPException - if there is a SOAP error

addFault

public SOAPFault addFault(Name name,
                          String s)
            throws SOAPException
Creates a new SOAPFault object and adds it to this SOAPBody object. The new SOAPFault will have a faultcode element that is set to the faultCode parameter and a faultstring set to faultstring.
Specified by:
addFault in interface SOAPBody
Parameters:
Returns:
the new SOAPFault object
Throws:
SOAPException - if there is a SOAP error

addFault

public SOAPFault addFault(Name name,
                          String s,
                          Locale locale)
            throws SOAPException
Creates a new SOAPFault object and adds it to this SOAPBody object. The new SOAPFault will have a faultcode element that is set to the faultCode parameter and a faultstring set to faultstring and localized to locale.
Specified by:
addFault in interface SOAPBody
Parameters:
locale - a Locale object indicating the native language of the faultString
Returns:
the new SOAPFault object
Throws:
SOAPException - if there is a SOAP error

disableFormatting

public void disableFormatting()

getFault

public SOAPFault getFault()
Returns the SOAPFault object in this SOAPBody object.
Specified by:
getFault in interface SOAPBody
Returns:
the SOAPFault object in this SOAPBody object

hasFault

public boolean hasFault()
Indicates whether a SOAPFault object exists in this SOAPBody object.
Specified by:
hasFault in interface SOAPBody
Returns:
true if a SOAPFault object exists in this SOAPBody object; false otherwise

outputImpl

protected void outputImpl(SerializationContext context)
            throws Exception
Overrides:
outputImpl in interface MessageElement

setEncodingStyle

public void setEncodingStyle(String encodingStyle)
            throws SOAPException
Sets the encoding style for this SOAPElement object to one specified.
Specified by:
setEncodingStyle in interface SOAPElement
Overrides:
setEncodingStyle in interface MessageElement
Parameters:
encodingStyle - a String giving the encoding style

setParentElement

public void setParentElement(SOAPElement parent)
            throws SOAPException
Sets the parent of this Node object to the given SOAPElement object.
Specified by:
setParentElement in interface Node
Overrides:
setParentElement in interface NodeImpl
Parameters:
parent - the SOAPElement object to be set as the parent of this Node object
Throws:
SOAPException - if there is a problem in setting the parent to the given element

setSAAJEncodingCompliance

public void setSAAJEncodingCompliance(boolean comply)

Copyright B) 2005 Apache Web Services Project. All Rights Reserved.