This week's book giveaway is in the Artificial Intelligence forum.
We're giving away four copies of Pragmatic AI and have Noah Gift on-line!
See this thread for details.
Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

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

 
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
 
Sheriff
Posts: 23647
49
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.
 
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
 
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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!