savon-xaop 0.7.2.3 → 0.7.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/savon/request.rb +9 -18
- data/lib/savon/wsdl.rb +1 -1
- metadata +3 -3
data/lib/savon/request.rb
CHANGED
@@ -77,7 +77,7 @@ module Savon
|
|
77
77
|
|
78
78
|
# Sets the +username+ and +password+ for NTLM authentication.
|
79
79
|
def ntlm_auth(username, password)
|
80
|
-
@ntlm_auth = [username, password]
|
80
|
+
@ntlm_auth = [username, password, true]
|
81
81
|
end
|
82
82
|
|
83
83
|
# Retrieves WSDL document and returns the Net::HTTP response.
|
@@ -85,14 +85,7 @@ module Savon
|
|
85
85
|
log "Retrieving WSDL from: #{@endpoint}"
|
86
86
|
http.endpoint @endpoint.host, @endpoint.port
|
87
87
|
http.use_ssl = @endpoint.ssl?
|
88
|
-
|
89
|
-
# Actually it should be possible to select the authentication
|
90
|
-
# mechanism based on the returned header.
|
91
|
-
result = http.start { |h| h.request request(:wsdl, false) }
|
92
|
-
if Net::HTTPUnauthorized === result
|
93
|
-
result = http.start { |h| h.request request(:wsdl, true) }
|
94
|
-
end
|
95
|
-
result
|
88
|
+
http.start { |h| h.request request(:wsdl) }
|
96
89
|
end
|
97
90
|
|
98
91
|
# Executes a SOAP request using a given Savon::SOAP instance and
|
@@ -132,19 +125,17 @@ module Savon
|
|
132
125
|
|
133
126
|
# Returns a Net::HTTP request for a given +type+. Yields the request
|
134
127
|
# to an optional block.
|
135
|
-
def request(type
|
128
|
+
def request(type)
|
136
129
|
request = case type
|
137
130
|
when :wsdl then Net::HTTP::Get.new @endpoint.to_s, headers
|
138
131
|
when :soap then Net::HTTP::Post.new @soap.endpoint.to_s, headers.merge(soap_headers)
|
139
132
|
end
|
140
|
-
if
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
request.ntlm_auth *@ntlm_auth
|
147
|
-
end
|
133
|
+
if @basic_auth
|
134
|
+
request.basic_auth *@basic_auth
|
135
|
+
elsif @ntlm_auth
|
136
|
+
log "Using NTLM authentication"
|
137
|
+
require 'net/ntlm_http'
|
138
|
+
request.ntlm_auth *@ntlm_auth
|
148
139
|
end
|
149
140
|
yield request if block_given?
|
150
141
|
request
|
data/lib/savon/wsdl.rb
CHANGED
@@ -91,7 +91,7 @@ module Savon
|
|
91
91
|
|
92
92
|
@section = tag.to_sym if @depth <= 2 && Sections.include?(tag)
|
93
93
|
@namespace_uri ||= attrs["targetNamespace"] if @section == :definitions
|
94
|
-
@soap_endpoint ||= URI(attrs["location"]) if @section == :service && tag == "address"
|
94
|
+
@soap_endpoint ||= URI(URI.escape(attrs["location"])) if @section == :service && tag == "address"
|
95
95
|
|
96
96
|
operation_from tag, attrs if @section == :binding && tag == "operation"
|
97
97
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: savon-xaop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 119
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
9
|
- 2
|
10
|
-
-
|
11
|
-
version: 0.7.2.
|
10
|
+
- 4
|
11
|
+
version: 0.7.2.4
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Daniel Harrington
|