# Rails and .net webservices

**URL:** <https://www.ruby-forum.com/t/rails-and-net-webservices/60920>\
**Category:** Rails\
**Created:** [May 18, 2006, 4:38pm UTC](https://www.ruby-forum.com/t/rails-and-net-webservices/60920 "2006-05-18T16:38:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![barcik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@barcik](https://www.ruby-forum.com/u/barcik)\
**Post date:** [May 18, 2006, 4:38pm UTC](https://www.ruby-forum.com/t/rails-and-net-webservices/60920/1 "2006-05-18T16:38:55Z")

</div>

Hello.  
I am novice in ruby.  
How can i use .net webservice method from ruby.

Thanks.

---

<div class="post-metadata">

**Author:** ![barcik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@barcik](https://www.ruby-forum.com/u/barcik)\
**Post date:** [May 18, 2006, 5:16pm UTC](https://www.ruby-forum.com/t/rails-and-net-webservices/60920/2 "2006-05-18T17:16:55Z")

</div>

> I am novice in ruby.  
> How can i use .net webservice method from ruby.

I’ve used soap4r to access a .net (soap) webservice:  
[http://dev.ctor.org/soap4r](http://dev.ctor.org/soap4r)

Some examples of using soap4r:  
[http://www.pranavbihari.com/articles/2005/12/02/testing-paypal-web-services-with-ruby-soap4r](http://www.pranavbihari.com/articles/2005/12/02/testing-paypal-web-services-with-ruby-soap4r)  
[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/153441](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/153441)

---

<div class="post-metadata">

**Author:** ![barcik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@barcik](https://www.ruby-forum.com/u/barcik)\
**Post date:** [May 19, 2006, 9:57am UTC](https://www.ruby-forum.com/t/rails-and-net-webservices/60920/3 "2006-05-19T09:57:03Z")

</div>

Can anybody write a working code to access to .net websrevice.

I have a simple web service

[WebMethod]  
public string HelloWorld()  
{  
return “Hello!!!”;  
}

And i have a ruby code

def HelloWorld  
soap\_client = ActionWebService::Client::Soap.new(Service1,  
“[http://localhost/WebApplication4/Service1.asmx](http://localhost/WebApplication4/Service1.asmx)”)  
soap\_client.default\_encodingstyle =  
SOAP::EncodingStyle::ASPDotNetHandler::Namespace  
soap\_client.HelloWorld()  
end

Is it correct?? Where can i write it??? Help please.

Thanks a lot.
