Forum: Ruby on Rails Problem with web services

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Sal00m geckko (Guest)
on 2006-02-09 18:35
(Received via mailing list)
Hi all:

First of all i apologize for my poor english, if don't understand
please tell me, and i will try to explain again.

Hi have a litlle problem with web services. I explain, i a have a web
service in php that return a structure seems to this:

    [url] =>
    [crm] => Array
            [0] => Array
                    [surname] => AAAA
                    [category] => Client

                    [email] => removed_email_address@domain.invalid
                    [nifCif] => 000000000-Q
                    [name] => PRUEBA
                    [phone] =>

                    [phone] =>
                    [clientype] => 1
                    [doctype] =>
                    [clientStatus] => CLIENT
                    [id] => 0000001

                    [version] =>


    [tipoDoc] => NIF

This is a print_r in php of the response of web service.

Well, the problem is how to map the SOAP OBJECT that uses ruby, in a
hash or
array, for simple access to the values that the web service return. hope
explain correctly :S

My code now is this:
@proxy ="",nil<http://17...)
@proxy.add_method("GetbyDocument", "id","contract","action")
@result = @proxy.GetbyDocument(@documento,@contrato,"")

 - "GetByDocument" is the name of the web service and id, contract and
action are the params of the method.

In the next line i invoke the web service method and in the result
i obtain the response of the web service, the SOAP OBJECT, and i dont
how to access the values like i do in PHP

I need something like this.


@arrayAux =
@arrayAux = @resultado.valores //the values of the response of web

To obtein doctype ---> @arrayAux[2] ---> NIF
To obtain clientstatus ---> @arrayAux[1][0][9] ---> CLIENT

Hope you will understand me, Thanks in advance.
This topic is locked and can not be replied to.