savon-xaop 0.7.2.2 → 0.7.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/savon/request.rb +17 -8
- metadata +77 -28
data/lib/savon/request.rb
CHANGED
@@ -85,7 +85,14 @@ 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
|
-
|
88
|
+
# This is not yet ideal, but better at least.
|
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
|
89
96
|
end
|
90
97
|
|
91
98
|
# Executes a SOAP request using a given Savon::SOAP instance and
|
@@ -125,17 +132,19 @@ module Savon
|
|
125
132
|
|
126
133
|
# Returns a Net::HTTP request for a given +type+. Yields the request
|
127
134
|
# to an optional block.
|
128
|
-
def request(type)
|
135
|
+
def request(type, authenticate = true)
|
129
136
|
request = case type
|
130
137
|
when :wsdl then Net::HTTP::Get.new @endpoint.to_s, headers
|
131
138
|
when :soap then Net::HTTP::Post.new @soap.endpoint.to_s, headers.merge(soap_headers)
|
132
139
|
end
|
133
|
-
if
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
140
|
+
if authenticate
|
141
|
+
if @basic_auth
|
142
|
+
request.basic_auth *@basic_auth
|
143
|
+
elsif @ntlm_auth
|
144
|
+
log "Using NTLM authentication"
|
145
|
+
require 'net/ntlm_http'
|
146
|
+
request.ntlm_auth *@ntlm_auth
|
147
|
+
end
|
139
148
|
end
|
140
149
|
yield request if block_given?
|
141
150
|
request
|
metadata
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: savon-xaop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 121
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 7
|
9
|
+
- 2
|
10
|
+
- 3
|
11
|
+
version: 0.7.2.3
|
5
12
|
platform: ruby
|
6
13
|
authors:
|
7
14
|
- Daniel Harrington
|
@@ -14,64 +21,100 @@ default_executable:
|
|
14
21
|
dependencies:
|
15
22
|
- !ruby/object:Gem::Dependency
|
16
23
|
name: builder
|
17
|
-
|
18
|
-
|
19
|
-
|
24
|
+
prerelease: false
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
20
27
|
requirements:
|
21
28
|
- - ">="
|
22
29
|
- !ruby/object:Gem::Version
|
30
|
+
hash: 15
|
31
|
+
segments:
|
32
|
+
- 2
|
33
|
+
- 1
|
34
|
+
- 2
|
23
35
|
version: 2.1.2
|
24
|
-
|
36
|
+
type: :runtime
|
37
|
+
version_requirements: *id001
|
25
38
|
- !ruby/object:Gem::Dependency
|
26
39
|
name: crack
|
27
|
-
|
28
|
-
|
29
|
-
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
30
43
|
requirements:
|
31
44
|
- - ">="
|
32
45
|
- !ruby/object:Gem::Version
|
46
|
+
hash: 19
|
47
|
+
segments:
|
48
|
+
- 0
|
49
|
+
- 1
|
50
|
+
- 4
|
33
51
|
version: 0.1.4
|
34
|
-
|
52
|
+
type: :runtime
|
53
|
+
version_requirements: *id002
|
35
54
|
- !ruby/object:Gem::Dependency
|
36
55
|
name: ntlm-http
|
37
|
-
|
38
|
-
|
39
|
-
|
56
|
+
prerelease: false
|
57
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
40
59
|
requirements:
|
41
60
|
- - ">="
|
42
61
|
- !ruby/object:Gem::Version
|
62
|
+
hash: 25
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
- 1
|
66
|
+
- 1
|
43
67
|
version: 0.1.1
|
44
|
-
|
68
|
+
type: :runtime
|
69
|
+
version_requirements: *id003
|
45
70
|
- !ruby/object:Gem::Dependency
|
46
71
|
name: rspec
|
47
|
-
|
48
|
-
|
49
|
-
|
72
|
+
prerelease: false
|
73
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
50
75
|
requirements:
|
51
76
|
- - ">="
|
52
77
|
- !ruby/object:Gem::Version
|
78
|
+
hash: 15
|
79
|
+
segments:
|
80
|
+
- 1
|
81
|
+
- 2
|
82
|
+
- 8
|
53
83
|
version: 1.2.8
|
54
|
-
|
84
|
+
type: :development
|
85
|
+
version_requirements: *id004
|
55
86
|
- !ruby/object:Gem::Dependency
|
56
87
|
name: mocha
|
57
|
-
|
58
|
-
|
59
|
-
|
88
|
+
prerelease: false
|
89
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
60
91
|
requirements:
|
61
92
|
- - ">="
|
62
93
|
- !ruby/object:Gem::Version
|
94
|
+
hash: 53
|
95
|
+
segments:
|
96
|
+
- 0
|
97
|
+
- 9
|
98
|
+
- 7
|
63
99
|
version: 0.9.7
|
64
|
-
|
100
|
+
type: :development
|
101
|
+
version_requirements: *id005
|
65
102
|
- !ruby/object:Gem::Dependency
|
66
103
|
name: fakeweb
|
67
|
-
|
68
|
-
|
69
|
-
|
104
|
+
prerelease: false
|
105
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
70
107
|
requirements:
|
71
108
|
- - ">="
|
72
109
|
- !ruby/object:Gem::Version
|
110
|
+
hash: 17
|
111
|
+
segments:
|
112
|
+
- 1
|
113
|
+
- 2
|
114
|
+
- 7
|
73
115
|
version: 1.2.7
|
74
|
-
|
116
|
+
type: :development
|
117
|
+
version_requirements: *id006
|
75
118
|
description:
|
76
119
|
email: me@rubiii.com
|
77
120
|
executables: []
|
@@ -142,21 +185,27 @@ rdoc_options:
|
|
142
185
|
require_paths:
|
143
186
|
- lib
|
144
187
|
required_ruby_version: !ruby/object:Gem::Requirement
|
188
|
+
none: false
|
145
189
|
requirements:
|
146
190
|
- - ">="
|
147
191
|
- !ruby/object:Gem::Version
|
192
|
+
hash: 3
|
193
|
+
segments:
|
194
|
+
- 0
|
148
195
|
version: "0"
|
149
|
-
version:
|
150
196
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
|
+
none: false
|
151
198
|
requirements:
|
152
199
|
- - ">="
|
153
200
|
- !ruby/object:Gem::Version
|
201
|
+
hash: 3
|
202
|
+
segments:
|
203
|
+
- 0
|
154
204
|
version: "0"
|
155
|
-
version:
|
156
205
|
requirements: []
|
157
206
|
|
158
207
|
rubyforge_project:
|
159
|
-
rubygems_version: 1.3.
|
208
|
+
rubygems_version: 1.3.7
|
160
209
|
signing_key:
|
161
210
|
specification_version: 3
|
162
211
|
summary: Heavy metal Ruby SOAP client library
|