Problem with web services


#1

Hi all:

First of all i apologize for my poor english, if don’t understand
something
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:

Array
(
[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
i
explain correctly :S

My code now is this:
@proxy =
SOAP::RPC::Driver.new(“http://172.16.11.12:8888/server.php”,nilhttp://172.16.242.43:7109/server.php",nil)
@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
variable
i obtain the response of the web service, the SOAP OBJECT, and i dont
know
how to access the values like i do in PHP

I need something like this.

Eg:

@arrayAux = Hash.new()
@arrayAux = @resultado.valores //the values of the response of web
service

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

Hope you will understand me, Thanks in advance.