com.ibm.websphere.webservices.soap
Interface IBMSOAPElement

All Superinterfaces:
org.w3c.dom.Element, Node, org.w3c.dom.Node, SOAPElement

public interface IBMSOAPElement
extends SOAPElement

This interface exposes new IBM value-add methods.


Field Summary
 
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
 
Method Summary
 SOAPElement addComment(java.lang.String text)
          Creates a new Comment object initialized with the given String and adds it to this javax.xml.soap.SOAPElement object.
 SOAPElement addSwaRefTextNode(java.lang.String mimeType, java.lang.Object attachment)
          Add an swaRef text node to this SOAPElement.
 org.w3c.dom.NodeList getChildNodes()
          Returns the list of child nodes for this SOAPElement.
 Name getNameFromText(java.lang.String text)
          A javax.xml.soap.Name is constructed from the input text and the namespace/prefix information defined by the SOAPElement.
 java.lang.Object getSwaRefAttachment()
          Get the attachment referred to by this swaRef.
 java.lang.Object getSwaRefAttachment(SOAPMessage message)
          Get the attachment referred to by this swaRef.
 java.lang.String getTextFromName(Name name, boolean autoGenPrefix)
          A text String is created that represents the Name.
 boolean isSwaRef()
          Deterimine if this SOAPElement is an swaRef.
 org.xml.sax.InputSource toInputSource(boolean includeNSDecls)
          Get an InputSource representing this SOAPElement.
 java.lang.String toXMLString(boolean includeNSDecls)
          Get a string of xml representing this SOAPElement.
 
Methods inherited from interface javax.xml.soap.SOAPElement
addAttribute, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addTextNode, getAllAttributes, getAttributeValue, getChildElements, getChildElements, getElementName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeContents, removeNamespaceDeclaration, setEncodingStyle
 
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, 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
 

Method Detail

toXMLString

public java.lang.String toXMLString(boolean includeNSDecls)
Get a string of xml representing this SOAPElement.

There are actually two representations of a SOAPElement as a string:

If includeNSDecls is false, the first representation is used.

If includeNSDecls is true, the second representation is used.

Parameters:
includeNSDecls - boolean
Returns:
String

toInputSource

public org.xml.sax.InputSource toInputSource(boolean includeNSDecls)
                                      throws org.xml.sax.SAXException
Get an InputSource representing this SOAPElement.

There are actually two representations of a SOAPElement:

If includeNSDecls is false, the first representation is used.

If includeNSDecls is true, the second representation is used.

Parameters:
includeNSDecls - boolean
Returns:
InputSource
Throws:
org.xml.sax.SAXException

getNameFromText

public Name getNameFromText(java.lang.String text)
A javax.xml.soap.Name is constructed from the input text and the namespace/prefix information defined by the SOAPElement.
 Example:
 
 Input:
   text = "pre:foo" 
   SOAPElement = 

 Output:
   Name with the following information:
     prefix    = "pre"
     localName = "foo"
     uri       = "http://namespace"
     qualified name = "pre:foo"
 

Intended Use: A SOAPElement may contain a text value or an attribute value that represents a QName. This utility method is useful for obtaining the Name from the text.

Parameters:
text - String representing a QName.
Returns:
Name representing the text or null

getTextFromName

public java.lang.String getTextFromName(Name name,
                                        boolean autoGenPrefix)
A text String is created that represents the Name.

The SOAPElement is changed to add any necessary namespace/prefix information. This is the reverse of the getNameFromText method above.

 Example:
 
 Input
   SOAPElement = 
   Name has the following information:  
      prefix    = "pre"
      localName = "foo"
      uri       = "http://namespace"
      qualified name = "pre:foo"
 
 Output:
   SOAPElement = 
   text = "pre:foo"
 

Intended Use: A SOAPElement may contain a text value or an attribute value that represents a QName. This utility method is useful for setting the value from a Name object.

Parameters:
name -
autoGenPrefix - boolean if set to true, the prefix in the Name is ignored and a new prefix is automatically generated.
Returns:
Text representing name or null. Side effect: SOAPElement updated with namespace information

addSwaRefTextNode

public SOAPElement addSwaRefTextNode(java.lang.String mimeType,
                                     java.lang.Object attachment)
                              throws SOAPException
Add an swaRef text node to this SOAPElement.

This method is an addition to the standard SAAJ functionality. However, this functionality may be added to SAAJ in the future, in which case it will then become deprecated.

Parameters:
mimeType - MIME data type of the swaRef
attachment - The attachment object. The class of this object must match the mimeType.
Throws:
SOAPException - if the attachment could not be added, or the attachment object doesn't match the mimeType:
 image/gif, image/jpeg     ==> java.awt.Image
 text/plain                ==> java.lang.String
 multipart/*               ==> javax.mail.internet.MimeMultipart
 text/xml, application/xml ==> javax.xml.transform.Source
 all others                ==> javax.activation.DataHandler
 
SOAPException

isSwaRef

public boolean isSwaRef()
Deterimine if this SOAPElement is an swaRef.

This method is an addition to the standard SAAJ functionality. However, this functionality may be added to SAAJ in the future, in which case it will then become deprecated.

Returns:
true if this SOAPElement is an swaRef

getSwaRefAttachment

public java.lang.Object getSwaRefAttachment()
                                     throws SOAPException
Get the attachment referred to by this swaRef. Note that there are two versions of this method: one takes no parameters; the other takes a SOAPMessage.

SOAPMessage has methods to get attachments. The no-parameter version is slightly less efficient since it has to find the SOAPMessage associated with this SOAPElement.

This method is an addition to the standard SAAJ functionality. However, this functionality may be added to SAAJ in the future, in which case it will then become deprecated.

Throws:
SOAPException - if this SOAPElement is not an swaRef
SOAPException

getSwaRefAttachment

public java.lang.Object getSwaRefAttachment(SOAPMessage message)
                                     throws SOAPException
Get the attachment referred to by this swaRef.

Note that there are two versions of this method: one takes no parameters; the other takes a SOAPMessage.

SOAPMessage has methods to get attachments. The no-parameter version is slightly less efficient since it has to find the SOAPMessage associated with this SOAPElement.

This method is an addition to the standard SAAJ functionality. However, this functionality may be added to SAAJ in the future, in which case it will then become deprecated.

Parameters:
message - If you have the SOAPMessage associated with this SOAPElement, give it to this method so it doesn't have to look for it itself.
Throws:
SOAPException - if this SOAPElement is not an swaRef
SOAPException

getChildNodes

public org.w3c.dom.NodeList getChildNodes()
Returns the list of child nodes for this SOAPElement.

Note that the returned NodeList is not thread-safe. In a multi-threaded environment, use the DOM getFirstChild()/getNextSibling() methods to traverse the children.

For example, the following code may fail in a multi-threaded environment:

   NodeList nl = el.getChildNodes();       
   for (int i=0; i<.getLength(); i++) {  
      Node child = nl.item(i);             
      ...                                  
   }                                       
 
Here is the same logic using the getFirstChild()/getNextSibling() methods:
   for (Node child = el.getFirstChild();   
        child != null;                     
        child = child.getNextSibling()) {  
      ...                                  
   }                                       
 

Specified by:
getChildNodes in interface org.w3c.dom.Node
Returns:
the list of child notes for this SOAPElement

addComment

public SOAPElement addComment(java.lang.String text)
                       throws SOAPException
Creates a new Comment object initialized with the given String and adds it to this javax.xml.soap.SOAPElement object.

Parameters:
text - a String object with the textual content to be added
Returns:
the javax.xml.soap.SOAPElement object into which the new Comment object was inserted
Throws:
SOAPException - if there is an error in creating the new Comment object
SOAPException