• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

extract data from SOAP response

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

I use Axis engine.

I can't use web service, but I have an example SOAP response.

How to extract data from this response.

Question: how to deserialize java objects from this response? I have generated java classes using wsdltojava.


Thanks,
Andrei
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to Javaranch Andrew,
Thanks for posting at the under right forum category.

Regd your question..
Simply, the webserivces works in away that the client will send a SOAP request for which the server will send a SOAP response.
Now Axis is a tool which can help you to automate the above process. With that in mind, the client stub that you have generated using wsdl2java will call the server by sending the soap request and receives back the soap response. The client stub will also read this soap response and gives the reponsse data after deserialization. So the main purpose of this wsdl2java is: it will automatically do the job of serialization and deserialization upon such client-server interaction.

>I can't use web service, but I have an example SOAP response.
In that case, all you need is a simple DOM or SAX based xml parser to read the soap response. You dont need Axis for this.

Please also check our webservices FAQ. http://faq.javaranch.com/view?WebServicesFaq

Feel free to post back your doubts.
 
AndreI Sljusar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Balaji for a such a prompt reply.

"The client stub will also read this soap response and gives the reponsse data after deserialization."

It means I can't pass on my soap response as a byte stream, for example to the client stub programmatically and to call the methods.

Andrei
 
Balaji Loganathan
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No. To my knowledge Axis doesnt work that way.
For instance the axis method Invoke(...) in org.apache.axis.client.Call does all the job for you by calling other related classes.

IMHO, If you always happen to get the input as raw SOAP response without using webservices, then try to use DOM/SAX/JAXB/Castor etc., to read the xml data directly and convert them to my format.
 
AndreI Sljusar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am going to use web servces. Just I develop client side.

The web service server is not ready yet, but I was given a test response with data, which I would like to use to test web service client.

Andrei
 
Balaji Loganathan
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good.. lets wait and see what other moderators/ranchers suggest for your case.
 
Ranch Hand
Posts: 2023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have wsdl file. Why not just build a fake webservice and it just returns the test response.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or really just a servlet that responds with the pre-generated SOAP response, no matter what you post to it. If it were an actual web service, it would want to add its own headers and such, which would make it difficult to have it generate the exact response you need.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic