org.apache.axis.message
Class SOAPBody

java.lang.Object
  |
  +--org.apache.axis.message.MessageElement
        |
        +--org.apache.axis.message.SOAPBody
All Implemented Interfaces:
org.w3c.dom.Element, org.w3c.dom.Node, Node, java.io.Serializable, SOAPBody, SOAPElement

public class SOAPBody
extends MessageElement
implements SOAPBody

Holder for body elements.

Author:
Glyn Normington (glyn@apache.org)
See Also:
Serialized Form

Inner classes inherited from class org.apache.axis.message.MessageElement
MessageElement.QNameAttr
 
Fields inherited from class org.apache.axis.message.MessageElement
_isDirty, _isRoot, attributes, context, elementRep, encodingStyle, endEventIndex, href, id, log, message, name, namespaces, namespaceURI, parent, prefix, qNameAttrs, recorder, startContentsIndex, startEventIndex, textRep, typeQName
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
SOAPBody(java.lang.String namespace, java.lang.String localPart, java.lang.String prefix, org.xml.sax.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 el)
          Note that this method will log a error and no-op if there is a value (set using setObjectValue) in the MessageElement.
 SOAPElement addChildElement(SOAPElement element)
          we have to override this to enforce that SOAPHeader immediate children are exclusively of type SOAPHeaderElement (otherwise we'll get mysterious ClassCastExceptions down the road...)
 SOAPBodyElement addDocument(org.w3c.dom.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, java.lang.String s)
          Creates a new SOAPFault object and adds it to this SOAPBody object.
 SOAPFault addFault(Name name, java.lang.String s, java.util.Locale locale)
          Creates a new SOAPFault object and adds it to this SOAPBody object.
 void detachNode()
          Removes this Node object from the tree.
 void disableFormatting()
           
protected  MessageElement findElement(java.util.Vector vec, java.lang.String namespace, java.lang.String localPart)
           
 java.util.Iterator getChildElements()
          Returns an iterator over all the immediate content of this element.
 java.util.Iterator getChildElements(Name name)
          Returns an iterator over all the child elements with the specified name.
 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)
          Subclasses can override
 void removeChild(MessageElement child)
          Remove a child element.
 void setEncodingStyle(java.lang.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, addChildElement, addChildElement, addChildElement, addChildElement, addMapping, addNamespaceDeclaration, addTextNode, appendChild, cloneNode, getAllAttributes, getAsDocument, getAsDOM, getAsString, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getAttributesEx, getAttributeValue, getAttributeValue, getChildNodes, getChildren, getCompleteAttributes, getElementName, getElementsByTagName, getElementsByTagNameNS, getEncodingStyle, getEnvelope, getFirstChild, getFixupDeserializer, getHref, getID, getLastChild, getLocalName, getName, getNamespacePrefixes, getNamespaceURI, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getObjectValue, getObjectValue, getOwnerDocument, getParentElement, getParentNode, getPrefix, getPrefix, getPreviousSibling, getQName, getRealElement, getRecorder, getTagName, getType, getValue, getValueAsType, getValueAsType, getVisibleNamespacePrefixes, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, insertBefore, isDirty, isRoot, isSupported, makeAttributesEditable, normalize, output, publishContents, publishToHandler, recycleNode, removeAttribute, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, removeContents, removeNamespaceDeclaration, replaceChild, setAttribute, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setContentsIndex, setDirty, setEndIndex, setEnvelope, setFixupDeserializer, setName, setNamespaceURI, setNodeValue, setNSMappings, setObjectValue, setPrefix, setQName, setRecorder, setType, setValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.xml.soap.SOAPElement
addAttribute, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addTextNode, getAllAttributes, getAttributeValue, getElementName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeContents, removeNamespaceDeclaration
 
Methods inherited from interface javax.xml.soap.Node
getParentElement, getValue, recycleNode, setValue
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS
 

Constructor Detail

SOAPBody

public SOAPBody(java.lang.String namespace,
                java.lang.String localPart,
                java.lang.String prefix,
                org.xml.sax.Attributes attributes,
                DeserializationContext context,
                SOAPConstants soapConsts)
         throws AxisFault
Method Detail

setParentElement

public void setParentElement(SOAPElement parent)
                      throws SOAPException
Description copied from interface: Node
Sets the parent of this Node object to the given SOAPElement object.
Specified by:
setParentElement in interface Node
Overrides:
setParentElement in class MessageElement
Following copied from interface: javax.xml.soap.Node
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
See Also:
getParentElement()

detachNode

public void detachNode()
Description copied from interface: Node
Removes this Node object from the tree. Once removed, this node can be garbage collected if there are no application references to it.
Specified by:
detachNode in interface Node
Overrides:
detachNode in class MessageElement

disableFormatting

public void disableFormatting()

setEncodingStyle

public void setEncodingStyle(java.lang.String encodingStyle)
                      throws SOAPException
Description copied from interface: SOAPElement
Sets the encoding style for this SOAPElement object to one specified.
Specified by:
setEncodingStyle in interface SOAPElement
Overrides:
setEncodingStyle in class MessageElement
Following copied from interface: javax.xml.soap.SOAPElement
Parameters:
encodingStyle - a String giving the encoding style
Throws:
java.lang.IllegalArgumentException - if there was a problem in the encoding style being set.
See Also:
getEncodingStyle()

outputImpl

protected void outputImpl(SerializationContext context)
                   throws java.lang.Exception
Description copied from class: MessageElement
Subclasses can override
Overrides:
outputImpl in class MessageElement

findElement

protected MessageElement findElement(java.util.Vector vec,
                                     java.lang.String namespace,
                                     java.lang.String localPart)

addBodyElement

public SOAPBodyElement addBodyElement(Name name)
                               throws SOAPException
Description copied from interface: SOAPBody
Creates a new SOAPBodyElement object with the specified name and adds it to this SOAPBody object.
Specified by:
addBodyElement in interface SOAPBody
Following copied from interface: javax.xml.soap.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

addFault

public SOAPFault addFault(Name name,
                          java.lang.String s,
                          java.util.Locale locale)
                   throws SOAPException
Description copied from interface: SOAPBody
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
Following copied from interface: javax.xml.soap.SOAPBody
Parameters:
faultCode - a Name object giving the fault code to be set; must be one of the fault codes defined in the SOAP 1.1 specification and of type QName
faultString - a String giving an explanation of the fault
locale - a Locale object indicating the native language of the faultString
Returns:
the new SOAPFault object
Throws:
SOAPException - if there is a SOAP error

addFault

public SOAPFault addFault(Name name,
                          java.lang.String s)
                   throws SOAPException
Description copied from interface: SOAPBody
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
Following copied from interface: javax.xml.soap.SOAPBody
Parameters:
faultCode - a Name object giving the fault code to be set; must be one of the fault codes defined in the SOAP 1.1 specification and of type QName
faultString - a String giving an explanation of the fault
Returns:
the new SOAPFault object
Throws:
SOAPException - if there is a SOAP error

addDocument

public SOAPBodyElement addDocument(org.w3c.dom.Document document)
                            throws SOAPException
Description copied from interface: SOAPBody
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
Following copied from interface: javax.xml.soap.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
Description copied from interface: SOAPBody
Creates a new SOAPFault object and adds it to this SOAPBody object.
Specified by:
addFault in interface SOAPBody
Following copied from interface: javax.xml.soap.SOAPBody
Returns:
the new SOAPFault object
Throws:
SOAPException - if there is a SOAP error

getFault

public SOAPFault getFault()
Description copied from interface: SOAPBody
Returns the SOAPFault object in this SOAPBody object.
Specified by:
getFault in interface SOAPBody
Following copied from interface: javax.xml.soap.SOAPBody
Returns:
the SOAPFault object in this SOAPBody object

hasFault

public boolean hasFault()
Description copied from interface: SOAPBody
Indicates whether a SOAPFault object exists in this SOAPBody object.
Specified by:
hasFault in interface SOAPBody
Following copied from interface: javax.xml.soap.SOAPBody
Returns:
true if a SOAPFault object exists in this SOAPBody object; false otherwise

addChild

public void addChild(MessageElement el)
              throws SOAPException
Description copied from class: MessageElement
Note that this method will log a error and no-op if there is a value (set using setObjectValue) in the MessageElement.
Overrides:
addChild in class MessageElement

getChildElements

public java.util.Iterator getChildElements()
Description copied from interface: SOAPElement
Returns an iterator over all the immediate content of this element. This includes Text objects as well as SOAPElement objects.
Specified by:
getChildElements in interface SOAPElement
Overrides:
getChildElements in class MessageElement
Following copied from interface: javax.xml.soap.SOAPElement
Returns:
an iterator with the content of this SOAPElement object

getChildElements

public java.util.Iterator getChildElements(Name name)
Description copied from interface: SOAPElement
Returns an iterator over all the child elements with the specified name.
Specified by:
getChildElements in interface SOAPElement
Overrides:
getChildElements in class MessageElement
Following copied from interface: javax.xml.soap.SOAPElement
Parameters:
name - a Name object with the name of the child elements to be returned
Returns:
an Iterator object over all the elements in this SOAPElement object with the specified name

removeChild

public void removeChild(MessageElement child)
Description copied from class: MessageElement
Remove a child element.
Overrides:
removeChild in class MessageElement

addChildElement

public SOAPElement addChildElement(SOAPElement element)
                            throws SOAPException
we have to override this to enforce that SOAPHeader immediate children are exclusively of type SOAPHeaderElement (otherwise we'll get mysterious ClassCastExceptions down the road...)
Specified by:
addChildElement in interface SOAPElement
Overrides:
addChildElement in class MessageElement
Parameters:
element -  
Returns:
 
Throws:
SOAPException -  

setSAAJEncodingCompliance

public void setSAAJEncodingCompliance(boolean comply)


Copyright © 2003 Apache Web Services Project. All Rights Reserved.