File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes I need to parse the data of my webservice response. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "I need to parse the data of my webservice response." Watch "I need to parse the data of my webservice response." New topic

I need to parse the data of my webservice response.

himan Gupta

Joined: Jul 03, 2009
Posts: 2
I need to parse the data of my webservice response.
which looks like
<ul class="jive-sidebar-populartags">
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=abc&recursive=true" title="Used 1 times">abc</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=forthone&recursive=true" title="Used 1 times">forthone</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=hi&recursive=true" title="Used 1 times">hi</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=ho&recursive=true" title="Used 1 times">ho</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=jai&recursive=true" title="Used 1 times">jai</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=my&recursive=true" title="Used 1 times">my</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=myblog&recursive=true" title="Used 1 times">myblog</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=new&recursive=true" title="Used 1 times">new</a></li>
<li class="jive-tagset-popularity9"><a href="http://localhost:8080/jive_sbs/tags?tags=one&recursive=true" title="Used 2 times">one</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=question&recursive=true" title="Used 1 times">question</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=second&recursive=true" title="Used 1 times">second</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=taggggggggggggggggggggggggggggggg&recursive=true" title="Used 1 times">taggggggggggggggggggggggggggggggg</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=third&recursive=true" title="Used 1 times">third</a></li>
<li class="jive-tagset-popularity0"><a href="http://localhost:8080/jive_sbs/tags?tags=yea&recursive=true" title="Used 1 times">yea</a></li>
<p class="jive-sidebar-viewall">
<a href="http://localhost:8080/jive_sbs/tags&recursive=true">View all</a>

need to get the values between the links for example in the first link it is "abc"; if you can give codeAPI would be of great help

please help
Cristian Boariu

Joined: Jul 04, 2009
Posts: 9
Hi himan,
Have you solved it?

I recommend using XMLBeans from apache to read the xml.

Yeah, you have to read the tutorial and try yourself but at the end you'll
enjoy the way XMLBeans handles the xmls files.

Have a look at this tutorial:

Have fun.

Software Developer - Java
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1183

As long as you pass a well-formed XML, any XML parser, such as DOM, SAX, etc. can parse it.

I'm not sure you deal here with well-formed XML. Got the following message from IE when trying to view your data (after introducing a root element) -

A semi colon character was expected.

BTW, do you pass plain HTML in the response?


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
I agree. Here's the link:
subject: I need to parse the data of my webservice response.
It's not a secret anymore!