# Response object in SOAP

**URL:** <https://www.ruby-forum.com/t/response-object-in-soap/173774>\
**Category:** Ruby\
**Created:** [August 14, 2009, 3:33pm UTC](https://www.ruby-forum.com/t/response-object-in-soap/173774 "2009-08-14T15:33:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bogea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ec9cab/32.png) [@bogea](https://www.ruby-forum.com/u/bogea)\
**Post date:** [August 14, 2009, 3:33pm UTC](https://www.ruby-forum.com/t/response-object-in-soap/173774/1 "2009-08-14T15:33:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bogea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ec9cab/32.png) [@bogea](https://www.ruby-forum.com/u/bogea)\
**Post date:** [August 14, 2009, 4:38pm UTC](https://www.ruby-forum.com/t/response-object-in-soap/173774/2 "2009-08-14T16:38:51Z")

</div>

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
