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.
Files changed (2) hide show
  1. data/lib/savon/request.rb +17 -8
  2. 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
- http.start { |h| h.request request(:wsdl) }
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 @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
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
- version: 0.7.2.2
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
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
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
- version:
36
+ type: :runtime
37
+ version_requirements: *id001
25
38
  - !ruby/object:Gem::Dependency
26
39
  name: crack
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
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
- version:
52
+ type: :runtime
53
+ version_requirements: *id002
35
54
  - !ruby/object:Gem::Dependency
36
55
  name: ntlm-http
37
- type: :runtime
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
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
- version:
68
+ type: :runtime
69
+ version_requirements: *id003
45
70
  - !ruby/object:Gem::Dependency
46
71
  name: rspec
47
- type: :development
48
- version_requirement:
49
- version_requirements: !ruby/object:Gem::Requirement
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
- version:
84
+ type: :development
85
+ version_requirements: *id004
55
86
  - !ruby/object:Gem::Dependency
56
87
  name: mocha
57
- type: :development
58
- version_requirement:
59
- version_requirements: !ruby/object:Gem::Requirement
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
- version:
100
+ type: :development
101
+ version_requirements: *id005
65
102
  - !ruby/object:Gem::Dependency
66
103
  name: fakeweb
67
- type: :development
68
- version_requirement:
69
- version_requirements: !ruby/object:Gem::Requirement
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
- version:
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.5
208
+ rubygems_version: 1.3.7
160
209
  signing_key:
161
210
  specification_version: 3
162
211
  summary: Heavy metal Ruby SOAP client library