Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Some puzzles about org.apache.soap.Envelope  RSS feed

 
jin wj
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I'v got some problems about org.apache.soap.Envelope.
I want to deploy a web service to receive an xml file from a C++ client side, and I am sure that I have reached this step(and the C++ client side can receive the message from server side,that is, the content of the SOAPContext). But I got a problem of how to use the class of Envelope easier. I have ever used the class of org.jdom.Element, and I think it's so easy and convenient to deal with a XML file. But the class of org.w3c.dom.Element and org.w3c.dom.Node are so hard to be used. For examle, Node.getNodeName()returns a node name, but with a prefix of the node's type, this is so inconvenient.Can anybody tell me some way to use them easier? Or give me some example to do that.
Thanks for your help.
 
JeanLouis Marechaux
Ranch Hand
Posts: 906
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The values of nodeName, nodeValue, and attributes vary according to the node type as documented in the org.w3c.dom.Node API
(Check J2EE 1.3 for further information).
What kind of precess on the node whould you like to perform without being able to do it ?
 
jin wj
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have ever used the JDOM classes, and I think it's so easy to use. For example, When I get a Element object, I can do everything with it, but in the case of org.w3c.dom, I even confuse about the Node and Element classes,what difference between them? And how can I get informations from an Envelope class? Such as, I want to get an element of named "Address", and by the JDOM, I can do that like this: Element.getChild("Address"), is there any similar function in the org.w3c.dom?
By the way, I am a new use about XML and soap and web service, maybe I have make some mistake about, if u find some, your correction is appreciated.
Thanks u for ur attention.
 
JeanLouis Marechaux
Ranch Hand
Posts: 906
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
About the API questions, onvnce again, take a look at the API doc.
It will tell you thatNode is an Interace, and that Element implements this interface.
Using the API Javadoc, you'll be able to understand each class and their relation with each others.
To find an element from its name, there is 2 simple ways you can use :
1) use a TreeWalker to "walk" through the document
2) And even simpler, use XPath
HTH
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!