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

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

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

puts books.inspect

recurse it by hand?
require ‘pp’
puts books.pretty_inspect
?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs