Skip to content
coldnebo edited this page Dec 31, 2012 · 13 revisions

Status

This fork has been submitted as pull request savonrb/httpi#59.

How to Use

Just put this in your gemfile and smoke it...

gem 'httpi', :git => "https://github.com/coldnebo/httpi.git"

Motivation for this Fork

I'm trying to use Savon pointed at a Sharepoint intranet site guarded by NTLM authentication. The ntlm experimental branch of httpi didn't actually work for me and seems to have gone stale compared to the master. I'm not sure but that branch also seems to be using the windows-only NTLM support (possibly only v1) -- this didn't work for me since my Ruby environment is Linux based.

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 under net/http 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!!

Clone this wiki locally