Response object in SOAP

G

Gabriel Policiuc

Hi,

I use ruby to get a report by calling a soap based web service method.I
am getting a ruby object of this type SOAP::Mapping::Object.

I inspected the object; I tried getting the info out of the object
without luck.

Considering the soapResponse is the object returned by the web method I
have tried things like soapResponse["//some_elem"] .. stuff like that.
But I get nils (except for the root).

I can convert the response to an array .. using __xmlele I think and
then parse it. This should be a solution.

But what should I do to correctly parse the object?
How do I access the received envelope? This should be easy ..

thanks
 
G

Gabriel Policiuc

I solved it.

It seems the way to access the information within a SOAP object is to
call public_methods onto the response object and look for the method
that accesses an element. The return on that method is another object.
Once again you can see the public methods and so on, repeating those
steps until you reach the desired value.

check for which element to call by using the public_methods metod.

example

responseObject.public_methods

example

responseObject.dailyStatisticsRecords.dailyStatisticRecords.dailyStatisticsRecord.totalCommission
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top