Created
August 10, 2011 20:09
-
-
Save bensie/1138077 to your computer and use it in GitHub Desktop.
savon ntlm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "http://rubygems.org" | |
gem 'httpi', :git => 'git://github.com/bensie/httpi.git', :branch => 'ntlm' | |
gem 'savon' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require "bundler/setup" | |
require 'savon' | |
require 'pp' | |
SERVER = "nav" | |
PORT = 7047 | |
SERVER_INSTANCE = "DynamicsNAV" | |
COMPANY_NAME = "CompanyName" | |
BASE_PATH = "https://#{SERVER}:#{PORT}/#{SERVER_INSTANCE}/WS/#{COMPANY_NAME}" | |
HTTPI::Adapter.use = :net_http | |
client = Savon::Client.new do |wsdl, http| | |
wsdl.document = BASE_PATH + '/Page/orders' | |
http.auth.ntlm('user', 'domain', 'password') | |
http.auth.ssl.verify_mode = :none | |
end | |
# List available SOAP actions | |
pp client.wsdl.soap_actions | |
# Read | |
read = client.request :read do | |
soap.body = { "id" => 10000 } | |
end | |
# Create (with hash of attributes) | |
create_with_id = client.request :create do | |
soap.body = { "orders" => { "id" => 20000 } } | |
end |
Hello,
I am trying to consume web services of dynamics nav using following gems
gem 'httpi', :git => 'git://github.com/bensie/httpi.git', :branch => 'ntlm'
gem 'savon'
but I am not able to consume web services of dynamics nav.
I got following error
[1] pry(#Api::Services::ServicesController)> client.wsdl.soap_actions
D, [2016-02-24T19:23:18.013211 #20648] DEBUG -- : HTTPI executes HTTP GET using the net_http adapter
Savon::HTTP::Error:
from /home/.rvm/gems/ruby-2.2.2/gems/savon-0.9.11/lib/savon/wasabi/document.rb:36:in `resolve_document'
Could you please help me to solve this issue or consuming web services of dynamics nav?
Thanks,
Kapil
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I guess last line could of course also be:
gem 'savon', '~> 0.9'