NTLM 認証って言う奴。初めて使った。ruby-ntlm ってやつ使うと簡単にできたよ。
require 'ntlm/http'
require 'active_support'
http = Net::HTTP.new(uri.host, uri.port)
response = http.start do
request = Net::HTTP::Post.new(uri.path)
request.add_field('Content-Type', 'text/xml; charset=utf-8')
request.add_field('SOAPAction', 'http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute')
request.ntlm_auth('ユーザID', '', 'パスワード')
request.add_field('open_timeout', 30)
request.add_field('read_timeout', 30)
request.body = '投げるXML'
http.request(request)
end
hash = Hash.from_xml(response.body)