Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading data from SOAP Envelope

 
Sunny Diaz
Greenhorn
Posts: 16
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a soap envelope to a web Service whose implementation is unknown to me, i don't have webservice implementation or code, I am trying to read the Web Service data from different location or computer, I want to read data from this soap envelope in a java client application?

Does any one know how can it be done? i have been looking over the internet but didn't find anything relevant to my question.

Thanks

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since SOAP messages are guaranteed to be valid XML, you can use any XML parsing technique.

Normal SOAP clients build a DOM (Document Object Model) and extract data with the usual org.w3c.dom package methods. You might find it easier to use XPath methods which are slower but easier to express.

Bill
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also use SAAJ which is an extension of DOM. Overview of SAAJ says -

SAAJ and DOM
In SAAJ 1.2, the SAAJ APIs extend their counterparts in the org.w3c.dom package:

The Node interface extends the org.w3c.dom.Node interface.
The SOAPElement interface extends both the Node interface and the org.w3c.dom.Element interface.
The SOAPPart class implements the org.w3c.dom.Document interface.
The Text interface extends the org.w3c.dom.Text interface.


Regards,
Dan
 
Sunny Diaz
Greenhorn
Posts: 16
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dan,

thanks for your reply, I have exactly tried SAAJ api and my request soap was going but response was not coming.. there is some exceptions coming out.

I have one more question.
If i create a TestClient using a wsdl url location which is placed remotely over other server, and run this test Client over the Server, I get some methods visible in the testclient.jsp running on the server,

but i am not sure if it is giving everything what i need.. i think it is not giving me the data. Do i have to implement the client or what?

I have generated code from a wsdl using Top down approach and created the test client also using the same wsdl in Eclipse 3.6

Do you have any idea? please sure your experience if you have done this kind of work before.

Thanks again!
 
Sunny Diaz
Greenhorn
Posts: 16
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for creation of TestClient i followed the tutorial from the following link

http://www.eclipse.org/webtools/jst/components/ws/1.5/tutorials/WebServiceClient/WebServiceClient.html

Waiting for reply
Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!