-
Notifications
You must be signed in to change notification settings - Fork 150
Home
Just put this in your gemfile and smoke it...
gem 'httpi', :git => "https://github.com/coldnebo/httpi.git"
Because I'm trying to use Savon pointed at a site guarded by NTLM authentication. Yes, I'm aware that Savon is supposed to work with the ntlm experimental branch of httpi. No, it doesn't actually work for me. The existing ntlm branch of httpi is over a year old, and behind on several fixes. In addition (I can't be sure) but it seems to be using the windows-only NTLM support (possibly only v1) -- this does diddly squat for me since I'm on Linux and Mac.
So, first off, there is a great new NTLM kid on the block, rubyntlm which is native ruby, works on all platforms, and supports NTLM v2.
First thing first, I added support for HTTPI so that it could connect seamlessly using the rubyntlm gem:
HTTPI::Adapter.use = :net_http
request = HTTPI::Request.new("http://a_legacy_ntlm_protected_site")
request.auth.ntlm(user,pass)
response = HTTPI.get request
Yep, that easy.
Now, use Savon:
HTTPI::Adapter.use = :net_http
client = Savon::Client.new do |wsdl, http|
wsdl.document = "http://a_legacy_ntlm_protected_site"
http.auth.ntlm(user, pass)
end
# List available SOAP actions
puts client.wsdl.soap_actions
Oh wow! YES!! THANK YOU!!
Why don't I release this goodness as a pull-request to httpi? Well, it's very rough at this point, needs tests, etc. Personally, it's enough for what I need it for, but I'd love it if someone would take the concept and run with it.
If you want to pull it, be my guest! Same MIT license!