soapical.util
Class Soapkit

java.lang.Object
  extended bysoapical.util.Soapkit
All Implemented Interfaces:
SoapkitConstants

public class Soapkit
extends java.lang.Object
implements SoapkitConstants

The Soapkit provides the converters to and from SOAPElement.

to from
toSOAPElement
toSOAPHeaderElement
toSOAPBodyElement
Reader, InputSource
DOM Node
toString SOAPElement, DOM Node

Version:
$Revision: 1.2 $
$Date: 2003/04/24 13:26:24 $
Author:
Eric Kow (kow at loria point fr)

Field Summary
 
Fields inherited from interface soapical.util.SoapkitConstants
XMLNS
 
Constructor Summary
Soapkit()
           
 
Method Summary
static void deepCopy(javax.xml.soap.SOAPElement from, javax.xml.soap.SOAPElement to)
          Copy the child elements and attributes of the from node so that they are child elements of the to node.
static javax.xml.soap.SOAPFactory getSOAPFactory()
           
static javax.xml.soap.SOAPBodyElement toSOAPBodyElement(javax.xml.soap.SOAPBody body, org.xml.sax.InputSource input)
           
static javax.xml.soap.SOAPBodyElement toSOAPBodyElement(javax.xml.soap.SOAPBody body, org.w3c.dom.Node DOMNode)
          Returns a SOAPBodyElement which is essentially a copy of the DOM node argument.
static javax.xml.soap.SOAPBodyElement toSOAPBodyElement(javax.xml.soap.SOAPBody body, java.io.Reader reader)
          Parses the contents from the Reader parameter and returns the contents as a SOAPHeaderElement.
static javax.xml.soap.SOAPElement toSOAPElement(org.xml.sax.InputSource input)
           
static javax.xml.soap.SOAPElement toSOAPElement(org.w3c.dom.Node DOMNode)
          Returns a generic SOAPElement, which is essentially a copy of the DOM node argument.
static javax.xml.soap.SOAPElement toSOAPElement(java.io.Reader reader)
          Parses the contents from the Reader and returns the contents as a generic SOAPElement.
static javax.xml.soap.SOAPHeaderElement toSOAPHeaderElement(javax.xml.soap.SOAPHeader header, org.xml.sax.InputSource input)
           
static javax.xml.soap.SOAPHeaderElement toSOAPHeaderElement(javax.xml.soap.SOAPHeader header, org.w3c.dom.Node DOMNode)
          Returns a SOAPHeaderElement, which is essentially a copy of the DOM node argument.
static javax.xml.soap.SOAPHeaderElement toSOAPHeaderElement(javax.xml.soap.SOAPHeader header, java.io.Reader reader)
          Parses the contents from the Reader parameter and returns the contents as a SOAPHeaderElement.
static java.lang.String toString(org.w3c.dom.Node node)
          Convert a DOM node to XML string
static java.lang.String toString(javax.xml.soap.Node node)
          Convert a SOAP Node to XML string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Soapkit

public Soapkit()
Method Detail

toSOAPElement

public static javax.xml.soap.SOAPElement toSOAPElement(java.io.Reader reader)
                                                throws org.xml.sax.SAXException,
                                                       java.io.IOException,
                                                       javax.xml.soap.SOAPException
Parses the contents from the Reader and returns the contents as a generic SOAPElement.

Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.soap.SOAPException
See Also:
toSOAPHeaderElement(javax.xml.soap.SOAPHeader, java.io.Reader), toSOAPBodyElement(javax.xml.soap.SOAPBody, java.io.Reader)

toSOAPElement

public static javax.xml.soap.SOAPElement toSOAPElement(org.xml.sax.InputSource input)
                                                throws org.xml.sax.SAXException,
                                                       java.io.IOException,
                                                       javax.xml.soap.SOAPException
Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.soap.SOAPException

toSOAPHeaderElement

public static javax.xml.soap.SOAPHeaderElement toSOAPHeaderElement(javax.xml.soap.SOAPHeader header,
                                                                   java.io.Reader reader)
                                                            throws org.xml.sax.SAXException,
                                                                   java.io.IOException,
                                                                   javax.xml.soap.SOAPException
Parses the contents from the Reader parameter and returns the contents as a SOAPHeaderElement.

Parameters:
header - the parent of the desired SOAPHeaderElement
Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.soap.SOAPException
See Also:
toSOAPHeaderElement(javax.xml.soap.SOAPHeader, java.io.Reader), toSOAPBodyElement(javax.xml.soap.SOAPBody, java.io.Reader)

toSOAPHeaderElement

public static javax.xml.soap.SOAPHeaderElement toSOAPHeaderElement(javax.xml.soap.SOAPHeader header,
                                                                   org.xml.sax.InputSource input)
                                                            throws org.xml.sax.SAXException,
                                                                   java.io.IOException,
                                                                   javax.xml.soap.SOAPException
Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.soap.SOAPException

toSOAPBodyElement

public static javax.xml.soap.SOAPBodyElement toSOAPBodyElement(javax.xml.soap.SOAPBody body,
                                                               java.io.Reader reader)
                                                        throws org.xml.sax.SAXException,
                                                               java.io.IOException,
                                                               javax.xml.soap.SOAPException
Parses the contents from the Reader parameter and returns the contents as a SOAPHeaderElement.

Parameters:
body - the parent of the desired SOAPBodyElement
Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.soap.SOAPException
See Also:
toSOAPHeaderElement(javax.xml.soap.SOAPHeader, java.io.Reader), toSOAPBodyElement(javax.xml.soap.SOAPBody, java.io.Reader)

toSOAPBodyElement

public static javax.xml.soap.SOAPBodyElement toSOAPBodyElement(javax.xml.soap.SOAPBody body,
                                                               org.xml.sax.InputSource input)
                                                        throws org.xml.sax.SAXException,
                                                               java.io.IOException,
                                                               javax.xml.soap.SOAPException
Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.soap.SOAPException

toSOAPElement

public static javax.xml.soap.SOAPElement toSOAPElement(org.w3c.dom.Node DOMNode)
                                                throws javax.xml.soap.SOAPException
Returns a generic SOAPElement, which is essentially a copy of the DOM node argument.

Parameters:
DOMNode - the DOM node you wish to convert
Returns:
a SOAPElement representing a deep copy of the DOM node
Throws:
java.lang.IllegalArgumentException - if the node is not an ELEMENT_NODE
javax.xml.soap.SOAPException

toSOAPHeaderElement

public static javax.xml.soap.SOAPHeaderElement toSOAPHeaderElement(javax.xml.soap.SOAPHeader header,
                                                                   org.w3c.dom.Node DOMNode)
                                                            throws javax.xml.soap.SOAPException
Returns a SOAPHeaderElement, which is essentially a copy of the DOM node argument.

Parameters:
header - the SOAP header you wish for the output SOAPHeaderElement must be an element of
DOMNode - the DOM node you wish to convert
Returns:
a SOAPElement representing a deep copy of the DOM node
Throws:
java.lang.IllegalArgumentException - if the node is not an ELEMENT_NODE
javax.xml.soap.SOAPException

toSOAPBodyElement

public static javax.xml.soap.SOAPBodyElement toSOAPBodyElement(javax.xml.soap.SOAPBody body,
                                                               org.w3c.dom.Node DOMNode)
                                                        throws javax.xml.soap.SOAPException
Returns a SOAPBodyElement which is essentially a copy of the DOM node argument.

Parameters:
body - the SOAP body you wish for the output SOAPBodyElement must be an element of
DOMNode - the DOM node you wish to convert
Returns:
a SOAPElement representing a deep copy of the DOM node
Throws:
java.lang.IllegalArgumentException - if the node is not an ELEMENT_NODE
javax.xml.soap.SOAPException

getSOAPFactory

public static javax.xml.soap.SOAPFactory getSOAPFactory()
                                                 throws javax.xml.soap.SOAPException
Throws:
javax.xml.soap.SOAPException

toString

public static java.lang.String toString(org.w3c.dom.Node node)
                                 throws org.xml.sax.SAXException
Convert a DOM node to XML string

Throws:
org.xml.sax.SAXException

toString

public static java.lang.String toString(javax.xml.soap.Node node)
Convert a SOAP Node to XML string. FIXME: I still can't handle Text nodes correctly; I think the problem is when a SOAPElement has multiple text nodes; for example,
 
   some text
   
   some other text
 
 
If you read the API for Node.getValue()â it only refers to there being a single child. Does this mean you have to call detachNode on the first child in order access the second? Yech!


deepCopy

public static void deepCopy(javax.xml.soap.SOAPElement from,
                            javax.xml.soap.SOAPElement to)
                     throws javax.xml.soap.SOAPException
Copy the child elements and attributes of the from node so that they are child elements of the to node.

Throws:
javax.xml.soap.SOAPException