• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need to Help on passing org.w3c.dom.Node and org.w3c.dom.Document across wsdl  RSS feed

 
saravanan periasamy
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everybody,


I need give POC to my team like,

I have to pass org.w3c.dom.Document from client and service method do some process and return org.w3c.dom.Node Object as return type in the WSDL.

Here,

1. I have to give Axis oriented web service for tomcat deployment
2. Then web logic server oriented web service ( using servicegen ant task ).

Please help me in this case like,

How do we make the WSDL to support XML Object.


Thanks,
Saravanan
 
Paul Clapham
Sheriff
Posts: 22719
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what giving POC means, but web services do a good job of transmitting XML. So I would take that org.w3c.dom.Document object and serialize it as XML text before sending it.
 
saravanan periasamy
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank Paul.POC means proof of concept.

To serialize a object.

it should have public constructor and getters/setters method for each property in the class right?.I do not know,correct me if i am wrong.

Thanks.
Saravanan.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dont get on the wrong track here, you want to transmit the contents of the Document and Node, not the Java objects which implement these interfaces.

Ouutput of the contents of a Document object can be done with Transformers but before jumping in, go read one of the many excellent tutorials on processing XML with Java. Such as this one.

Bill
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!