ruby2soap¶ ↑
I started this project when I needed to call a WCF method which required cookies on init. Unfortunalty, I could not find any gem that will help me so, so I implemented it myself.
While working I noticed that I need more features - authentication, for example.
Please post any bugs, questions and feature requests using the ‘Issues’ page.
Thank you, Eric
Examples¶ ↑
Initialize the handler:
handler = WcfHandler.new('http://www.webservicex.net/CurrencyConvertor.asmx')
Simple objects:
handler.ConversionRate(:FromCurrency => 'ILS', :ToCurrency => 'GBP')
Statefull:
handler.Init(:userName => 'ericman93') handler.IncreaseScore() #the cookies saved automaticly
Complex type :
handler = WcfHandler.new('http://localhost:1659/Service1.svc') res = handler.GetDataUsingDataContract(:composite => {:BoolValue => true,:StringValue => "ruby2soap"})
Result¶ ↑
The object that the soap service function returns is actually a HTTP response with ‘result’ function that returns the actual value. If the value is a complex object, then it would be represented as a hash
Authentication¶ ↑
Available authentications
-
NTLM
-
Basic
-
Digest
NTLM Auth:
handler.ConversionRate({:FromCurrency => 'ILS', :ToCurrency => 'GBP'},SecutryProtocol::NTLM,'user','password')
With domain:
handler.ConversionRate({:FromCurrency => 'ILS', :ToCurrency => 'GBP'},SecutryProtocol::NTLM,'user','password','domain')