# Ruby and SOAP

**URL:** <https://www.ruby-forum.com/t/ruby-and-soap/84741>\
**Category:** Ruby\
**Created:** [February 7, 2007, 1:31pm UTC](https://www.ruby-forum.com/t/ruby-and-soap/84741 "2007-02-07T13:31:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/d07c76/32.png) [@nicken](https://www.ruby-forum.com/u/nicken)\
**Post date:** [February 7, 2007, 1:31pm UTC](https://www.ruby-forum.com/t/ruby-and-soap/84741/1 "2007-02-07T13:31:32Z")

</div>

Hello,

I’m trying to access a SOAP webservice written in C# .NET from Ruby  
(running on Ubuntu). The server has two classes within its namespace:

AddressSearch  
ServiceAuthentication

The namespace is

[http://local/blah/AddressSearch.asmx](http://local/blah/AddressSearch.asmx)

The problem is that the client only knows about one method,  
findAddress - a method of the AddressSearch class. I cannot get it to  
see the ServiceAuthentication class. Apparently I need to pass an  
instance of the Service Authentication class to a method of the  
Address search class. I’m basing this on some sampel C# .NET client  
code. I have been told that the response I am getting from the server  
is because I am not authenticated.

My problem is that in all the examples of SOAP I have seen, looking  
through the ruby mailing list archives, there is only one class dealt  
with at a time. Basically, I need to know if my understanding of what  
I am trying to do is wrong, if one SOAP namespace can contain multiple  
classes, and if so, how I can use these two different classes in the  
same ruby code.

My client code is:

```
def soap_me(postcode, streetname, town)

  @postcode = postcode
  @streetname = streetname
  @town = town

  wsdl_url = 

```

“[http://10.0.0.35/iedirectimage/AddressSearch.asmx?WSDL](http://10.0.0.35/iedirectimage/AddressSearch.asmx?WSDL)”

```
  soap = SOAP::WSDLDriverFactory.new(wsdl_url).create_rpc_driver

  auth = soap.ServiceAuthentication(:login => "addresstest",

```

:password =\> “password”)  
#The above line gives a undefined method `ServiceAuthentication’  
error

```
  res = soap.findAddress(:postcode => @postcode, :streetName =>

```

@streetname, :town =\> @town)  
puts res.inspect

```
end

```

soap\_me(“SW15 6JH”, “Upper Richmond Road”, “London”)

The WSDL is posted here:

[http://www.blacksworld.net/projects/stuff/wsdl.xml](http://www.blacksworld.net/projects/stuff/wsdl.xml)

Thanks for the help - I know my post is slightly confused - it  
reflects my state of mind!
