Originally posted by saravanan periasamy:
To serialize a object.
I think you are missing the point.
org.w3c.dom.Document is an object representation of XML text - so in a sense the XML text
is the serialized form and that is what you are supposed to send. Also org.w3c.dom.Document extends org.w3c.dom.Node - so a Document is a Node!
For a non-WSDL example check out
Axis 1.x Message Services. It lets you send and receive any org.w3c.dom.Documents in a
SOAP envelope. (An example can be found in samples/message/).
In WSDL the presence of a generic XML document is sometimes flagged with the "xsd:anyType" (
Mapping XML document to xsd:anyType). Under JWSDP "xsd:anyType" automatically maps to javax.xml.soap.SOAPElement from which you can extract your org.w3c.dom.Document (which is a org.w3c.dom.Node) for incoming XML. For outgoing XML you simply populate the javax.xml.soap.SOAPElement parameter/return value with your org.w3c.dom.Document.
JAX-RPC 1.1 implements this behavior for the "xsd:any" type. JAX-WS 2.0 maps "xsd:any" and "xsd:anyType" to org.w3c.dom.Element rather than javax.xml.soap.SOAPElement. (See:
Realizing Strategies for Document-Based Web Services With JAX-WS 2.0: Part 3 in a Series)
Tip: xsd:any: A cautionary tale