Sending User object (tried everything!)

3 views
Skip to first unread message

Sergio

unread,
Jun 16, 2009, 3:18:23 PM6/16/09
to soap4r

Here is my live service so you can try for yourself:
http://saoj-office.dyndns.org:8080/ts?wsdl

Now my code which does not work: (feel free to try for yourself)

require 'rubygems'
gem 'soap4r'
require 'soap/wsdlDriver'

url = 'http://saoj-office.dyndns.org:8080/ts?wsdl'
service = SOAP::WSDLDriverFactory.new(url).create_rpc_driver
puts service.sayHello(nil).m_return # OK
puts service.sayHelloTo("Sergio").m_return # Does not work
u = service.getUserFromEmail("sa...@saoj.com").m_return # OK
puts u.username
## How do I send an User object to the method sayHelloToUser(User
u) ???

c:\eclipse\workspace\HelloWS\ruby>ruby client.rb
Hi there! Now is: Tue Jun 16 16:12:09 BRT 2009
Hi null! Now is: Tue Jun 16 16:12:09 BRT 2009
saoj

PROBLEMS/QUESTIONS:

- See the "Hi null" in the second line of the output above? "Sergio"
parameter is not being passed to the server somehow.
- How do you pass an User object with an username attribute? I really
tried everything without success. This is now very clear at all. :-(


Sergio

unread,
Jun 16, 2009, 5:47:22 PM6/16/09
to soap4r
Solution: you have to pass the param objects created from you.

Ex: For the method sayHelloTo(String username) the classes SayHelloTo
and SayHelloToResponse get created for you.

Once I found out about that everything else was easy.

-Sergio

On Jun 16, 4:18 pm, Sergio <sergio.souj...@gmail.com> wrote:
> Here is my live service so you can try for yourself:http://saoj-office.dyndns.org:8080/ts?wsdl
>
> Now my code which does not work: (feel free to try for yourself)
>
> require 'rubygems'
> gem 'soap4r'
> require 'soap/wsdlDriver'
>
> url = 'http://saoj-office.dyndns.org:8080/ts?wsdl'
> service = SOAP::WSDLDriverFactory.new(url).create_rpc_driver
> puts service.sayHello(nil).m_return # OK
> puts service.sayHelloTo("Sergio").m_return # Does not work
> u = service.getUserFromEmail("s...@saoj.com").m_return # OK
Reply all
Reply to author
Forward
0 new messages