This content has been marked as final. Show 5 replies
Basically i am trying to convert following SOAP message response into java.........
<?xml version="1.0" encoding="utf-8"?>
Looking for way out.???........
Heh - all the tags in your question got stripped out by the forum-to-email bridge :-)
Anyway, basically you just parse the XML data. You can use some
kind of library if you like, but it turns out that parsing an XML response
that's consistently formatted the same way isn't all that hard to do directly.
In the HD cookbook project, we have a sample xlet that does just this, reading
weather data from some public web service out there (I forget which - maybe
Yahoo's?) The xlet could be converted to work on MHP or OCAP without
much work. This demo is in xlets/demos/weatherWidget, and the project
is at http://hdcookbook.com, click on the sumo wrestler. It's in the source-code repository,
but over on the right one of the links will let you browse individual files, which should
get you pretty quickly to the XML parser in this demo.
By the way, if you have a choice between JSON and XML in this environment, I'd
personally go with JSON. It's simpler to parse and faster - indeed, see
com.hdcookbook.grin.util.JsonIO in the cookbook repository. Of course, if you're
interacting with a server under your control and you want maximum performance, you
can use a more efficient binary format, too.
I've been using nanoXML-lite before on MHP.
Light an simple.
You could find the answer to your question in this related thread: [http://forums.sun.com/thread.jspa?threadID=5381015|http://forums.sun.com/thread.jspa?threadID=5381015]
me too i vote for Json !! it's very easy to deal with and, a lightweight computer data interchange format
especially if your application have some IPTV features it's highly recommended :)