# How to get the data from objects in ruby~~please help

**URL:** <https://www.ruby-forum.com/t/how-to-get-the-data-from-objects-in-ruby-please-help/128188>\
**Category:** Ruby\
**Created:** [February 5, 2008, 6:04pm UTC](https://www.ruby-forum.com/t/how-to-get-the-data-from-objects-in-ruby-please-help/128188 "2008-02-05T18:04:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sim9739](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a3d4f5/32.png) [@sim9739](https://www.ruby-forum.com/u/sim9739)\
**Post date:** [February 5, 2008, 6:04pm UTC](https://www.ruby-forum.com/t/how-to-get-the-data-from-objects-in-ruby-please-help/128188/1 "2008-02-05T18:04:32Z")

</div>

Hi all,

## I have a web service that will return a BookArray when getBooks method is called. The web service is in java. something like this–\> public BookArray getBooks(){…} BookArray,toString() will return all the books name and description in one string I have a ruby script that send the soap message to call this web service and finally print out the result.

require ‘soap/wsdlDriver’

WSDL\_URL = ‘[http://localhost:9002/BookSearch?wsdl](http://localhost:9002/BookSearch?wsdl)’

factory = SOAP::WSDLDriverFactory.new(WSDL\_URL)  
driver = factory.create\_rpc\_driver  
soap.wiredump\_dev = STDOUT

books = driver.getBooks()

## puts books.inspect

after run the ruby script, it didn’t print out the All the Book  
information in the BookArray.  
It printed [#SOAP::Mapping::Object:0xa73104].  
Dose anyone know how to get ruby to print the data in BookArray in  
string form. Something like the BookArray.toString().  
Thanks!!!

Sim

---

<div class="post-metadata">

**Author:** ![sim9739](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a3d4f5/32.png) [@sim9739](https://www.ruby-forum.com/u/sim9739)\
**Post date:** [February 5, 2008, 6:46pm UTC](https://www.ruby-forum.com/t/how-to-get-the-data-from-objects-in-ruby-please-help/128188/2 "2008-02-05T18:46:11Z")

</div>

> puts books.inspect

recurse it by hand?  
require ‘pp’  
puts books.pretty\_inspect  
?
