Java & XML

Hi,
i am working with SOAP and i have the methode below returning an XML. I would want to be able to grab an element in that XML and check what it is, how can i do that?

ret = baseServiceAxisImpl.handleResponse( call, new Object[] { params } );

================ Sample XML returned =========
.....
</soap:Header>
- <soap:Body>
- <SimpleUesrTokenRequiredResponse xmlns="http://dominica.com/WebServices/BAL">
- <SimpleUesrTokenRequiredResult>
  <Success>true</Success>
  <Message>inputString: foo</Message>
  </SimpleUesrTokenRequiredResult>
  </SimpleUesrTokenRequiredResponse>
  </soap:Body>
  </soap:Envelope>
  </log>
komlaaaAsked:
Who is Participating?
 
Giant2Commented:
Some example on using XPath here:
http://javaalmanac.com/egs/org.w3c.dom/pkg.html#XPath

Bye, Giant.
0
 
rama_krishna580Commented:
Hi,

you can use this...but there are lot of methodologies to do that...
http://javaboutique.internet.com/reviews/xml_javabeans/

R.K
0
 
Tommy BraasCommented:
Two other options would be to;
1. "Manually" search for the start and end tags of the data you're looking for
2. Use the built in XML parser http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/parsers/package-summary.html

For instance:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = factory.newDocumentBuilder();
Document document = documentBuilder.parse(yourInputGoesHere);

You can now look for your data.

Another option is to use XPath, also included with the latest JDK.
0
 
Tommy BraasCommented:
;-D
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.