savon 0.9.8 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,9 +4,10 @@ rvm:
4
4
  - 1.8.7
5
5
  - 1.9.2
6
6
  - 1.9.3
7
+ - jruby-18mode
8
+ - jruby-19mode
9
+ - rbx-18mode
10
+ - rbx-19mode
7
11
  - ree
8
- - rbx
9
- - rbx-2.0
10
- - jruby
11
12
  notifications:
12
13
  irc: "irc.freenode.org#savon"
@@ -1,3 +1,27 @@
1
+ ## 0.9.9 (2012-02-17)
2
+
3
+ * Improvement: [pull request 255](https://github.com/rubiii/savon/pull/255) - Raise an error if fetching
4
+ a remote WSDL fails. Possible fix for [issue 236](https://github.com/rubiii/savon/issues/236).
5
+
6
+ * Improvement: The value for elementFormDefault (:unqualified, :qualified) can now be specified when creating
7
+ a `Savon::Client`. For example:
8
+
9
+ ``` ruby
10
+ Savon::Client.new do
11
+ wsdl.element_form_default = :unqualified
12
+ end
13
+ ```
14
+
15
+ * Improvement: [pull request 263](https://github.com/rubiii/savon/pull/263) - The SOAP action can now be set
16
+ via a `:soap_action` key passed to the `#request` method.
17
+
18
+ ``` ruby
19
+ client.request(:get_user, :soap_action => :test_action)
20
+ ```
21
+
22
+ * Fix: [pull request 265](https://github.com/rubiii/savon/pull/265) - Fixes gemspec problems when bundling
23
+ under JRuby 1.6.5. Also fixes [issue 267](https://github.com/rubiii/savon/issues/267).
24
+
1
25
  ## 0.9.8 (2012-02-15)
2
26
 
3
27
  * Feature: Savon now ships with [Savon::Model](http://rubygems.org/gems/savon_model).
@@ -109,7 +109,7 @@ module Savon
109
109
  soap.endpoint = wsdl.endpoint
110
110
  soap.namespace_identifier = args[0]
111
111
  soap.namespace = wsdl.namespace
112
- soap.element_form_default = wsdl.element_form_default if wsdl.document?
112
+ soap.element_form_default = wsdl.element_form_default
113
113
 
114
114
  body = args[2].delete(:body)
115
115
  soap.body = body if body
@@ -122,7 +122,8 @@ module Savon
122
122
  soap.types[path] = type
123
123
  end
124
124
 
125
- set_soap_action args[1]
125
+ soap_action = args[2].delete(:soap_action) || args[1]
126
+ set_soap_action soap_action
126
127
  set_soap_input *args
127
128
  end
128
129
 
@@ -110,14 +110,8 @@ module Savon
110
110
  @namespace_identifier ||= :wsdl
111
111
  end
112
112
 
113
- # Returns whether all local elements should be namespaced. Might be set to :qualified,
114
- # but defaults to :unqualified.
115
- def element_form_default
116
- @element_form_default ||= :unqualified
117
- end
118
-
119
- # Sets whether all local elements should be namespaced.
120
- attr_writer :element_form_default
113
+ # Accessor for whether all local elements should be namespaced.
114
+ attr_accessor :element_form_default
121
115
 
122
116
  # Accessor for the default namespace URI.
123
117
  attr_accessor :namespace
@@ -1,5 +1,5 @@
1
1
  module Savon
2
2
 
3
- Version = "0.9.8"
3
+ Version = "0.9.9"
4
4
 
5
5
  end
@@ -30,7 +30,13 @@ module Savon
30
30
  # Resolves and returns the raw WSDL document.
31
31
  def resolve_document
32
32
  case document
33
- when /^http[s]?:/ then HTTPI.get(request).body
33
+ when /^http[s]?:/ then
34
+ response = HTTPI.get(request)
35
+ if response.error?
36
+ raise Savon::HTTP::Error.new(response)
37
+ else
38
+ response.body
39
+ end
34
40
  when /^</ then document
35
41
  else File.read(document)
36
42
  end
@@ -1,3 +1,4 @@
1
+ # -*- encoding : utf-8 -*-
1
2
  lib = File.expand_path("../lib", __FILE__)
2
3
  $:.unshift lib unless $:.include? lib
3
4
 
@@ -15,9 +16,9 @@ Gem::Specification.new do |s|
15
16
  s.rubyforge_project = s.name
16
17
 
17
18
  s.add_dependency "builder", ">= 2.1.2"
18
- s.add_dependency "nori", "~> 1.0"
19
+ s.add_dependency "nori", "~> 1.1"
19
20
  s.add_dependency "httpi", "~> 0.9"
20
- s.add_dependency "wasabi", "~> 2.0"
21
+ s.add_dependency "wasabi", "~> 2.1"
21
22
  s.add_dependency "akami", "~> 1.0"
22
23
  s.add_dependency "gyoku", ">= 0.4.0"
23
24
  s.add_dependency "nokogiri", ">= 1.4.0"
@@ -28,7 +29,7 @@ Gem::Specification.new do |s|
28
29
  s.add_development_dependency "timecop", "~> 0.3.5"
29
30
 
30
31
  s.add_development_dependency "autotest"
31
- s.add_development_dependency "ZenTest", "4.5.0"
32
+ s.add_development_dependency "ZenTest", "= 4.5.0"
32
33
 
33
34
  s.files = `git ls-files`.split("\n")
34
35
  s.require_path = "lib"
@@ -112,6 +112,10 @@ describe Savon::Client do
112
112
  it "should set the input tag to result in <getUser active='true'>" do
113
113
  client.request(:get_user, :active => true) { soap.input.should == [nil, :getUser, { :active => true }] }
114
114
  end
115
+
116
+ it "should use the :soap_action key to set the SOAPAction header" do
117
+ client.request(:get_user, :soap_action => :test_action) { http.headers["SOAPAction"].should == %{"testAction"} }
118
+ end
115
119
  end
116
120
 
117
121
  context "with two Symbols" do
@@ -138,6 +142,10 @@ describe Savon::Client do
138
142
  it "should set the input tag to result in <wsdl:getUser active='true'>" do
139
143
  client.request(:wsdl, :get_user, :active => true) { soap.input.should == [:wsdl, :getUser, { :active => true }] }
140
144
  end
145
+
146
+ it "should use the :soap_action key to set the SOAPAction header" do
147
+ client.request(:wsdl, :get_user, :soap_action => :test_action) { http.headers["SOAPAction"].should == %{"testAction"} }
148
+ end
141
149
  end
142
150
 
143
151
  context "with a block expecting one argument" do
@@ -17,6 +17,19 @@ describe Savon::Wasabi::Document do
17
17
  wsdl = Savon::Wasabi::Document.new("https://example.com?wsdl")
18
18
  wsdl.xml.should == Fixture.wsdl(:authentication)
19
19
  end
20
+
21
+ end
22
+
23
+ context "with an inaccessible remote document" do
24
+ before do
25
+ response = HTTPI::Response.new 401, {}, Fixture.wsdl(:authentication)
26
+ HTTPI.stubs(:get).returns(response)
27
+ end
28
+
29
+ it "should raise an error when authentication fails" do
30
+ wsdl = Savon::Wasabi::Document.new("http://example.com?wsdl")
31
+ expect { wsdl.xml }.to raise_error(Savon::HTTP::Error)
32
+ end
20
33
  end
21
34
 
22
35
  context "with a local document" do
metadata CHANGED
@@ -1,165 +1,233 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: savon
3
- version: !ruby/object:Gem::Version
4
- version: 0.9.8
3
+ version: !ruby/object:Gem::Version
4
+ hash: 41
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 9
9
+ - 9
10
+ version: 0.9.9
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Daniel Harrington
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-02-15 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: builder
16
- requirement: &2153571860 !ruby/object:Gem::Requirement
17
+
18
+ date: 2012-02-17 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ prerelease: false
22
+ type: :runtime
23
+ requirement: &id001 !ruby/object:Gem::Requirement
17
24
  none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 15
29
+ segments:
30
+ - 2
31
+ - 1
32
+ - 2
21
33
  version: 2.1.2
22
- type: :runtime
34
+ version_requirements: *id001
35
+ name: builder
36
+ - !ruby/object:Gem::Dependency
23
37
  prerelease: false
24
- version_requirements: *2153571860
25
- - !ruby/object:Gem::Dependency
26
- name: nori
27
- requirement: &2153571220 !ruby/object:Gem::Requirement
38
+ type: :runtime
39
+ requirement: &id002 !ruby/object:Gem::Requirement
28
40
  none: false
29
- requirements:
41
+ requirements:
30
42
  - - ~>
31
- - !ruby/object:Gem::Version
32
- version: '1.0'
33
- type: :runtime
43
+ - !ruby/object:Gem::Version
44
+ hash: 13
45
+ segments:
46
+ - 1
47
+ - 1
48
+ version: "1.1"
49
+ version_requirements: *id002
50
+ name: nori
51
+ - !ruby/object:Gem::Dependency
34
52
  prerelease: false
35
- version_requirements: *2153571220
36
- - !ruby/object:Gem::Dependency
37
- name: httpi
38
- requirement: &2153570580 !ruby/object:Gem::Requirement
53
+ type: :runtime
54
+ requirement: &id003 !ruby/object:Gem::Requirement
39
55
  none: false
40
- requirements:
56
+ requirements:
41
57
  - - ~>
42
- - !ruby/object:Gem::Version
43
- version: '0.9'
44
- type: :runtime
58
+ - !ruby/object:Gem::Version
59
+ hash: 25
60
+ segments:
61
+ - 0
62
+ - 9
63
+ version: "0.9"
64
+ version_requirements: *id003
65
+ name: httpi
66
+ - !ruby/object:Gem::Dependency
45
67
  prerelease: false
46
- version_requirements: *2153570580
47
- - !ruby/object:Gem::Dependency
48
- name: wasabi
49
- requirement: &2153570060 !ruby/object:Gem::Requirement
68
+ type: :runtime
69
+ requirement: &id004 !ruby/object:Gem::Requirement
50
70
  none: false
51
- requirements:
71
+ requirements:
52
72
  - - ~>
53
- - !ruby/object:Gem::Version
54
- version: '2.0'
55
- type: :runtime
73
+ - !ruby/object:Gem::Version
74
+ hash: 1
75
+ segments:
76
+ - 2
77
+ - 1
78
+ version: "2.1"
79
+ version_requirements: *id004
80
+ name: wasabi
81
+ - !ruby/object:Gem::Dependency
56
82
  prerelease: false
57
- version_requirements: *2153570060
58
- - !ruby/object:Gem::Dependency
59
- name: akami
60
- requirement: &2153569500 !ruby/object:Gem::Requirement
83
+ type: :runtime
84
+ requirement: &id005 !ruby/object:Gem::Requirement
61
85
  none: false
62
- requirements:
86
+ requirements:
63
87
  - - ~>
64
- - !ruby/object:Gem::Version
65
- version: '1.0'
66
- type: :runtime
88
+ - !ruby/object:Gem::Version
89
+ hash: 15
90
+ segments:
91
+ - 1
92
+ - 0
93
+ version: "1.0"
94
+ version_requirements: *id005
95
+ name: akami
96
+ - !ruby/object:Gem::Dependency
67
97
  prerelease: false
68
- version_requirements: *2153569500
69
- - !ruby/object:Gem::Dependency
70
- name: gyoku
71
- requirement: &2153569020 !ruby/object:Gem::Requirement
98
+ type: :runtime
99
+ requirement: &id006 !ruby/object:Gem::Requirement
72
100
  none: false
73
- requirements:
74
- - - ! '>='
75
- - !ruby/object:Gem::Version
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ hash: 15
105
+ segments:
106
+ - 0
107
+ - 4
108
+ - 0
76
109
  version: 0.4.0
77
- type: :runtime
110
+ version_requirements: *id006
111
+ name: gyoku
112
+ - !ruby/object:Gem::Dependency
78
113
  prerelease: false
79
- version_requirements: *2153569020
80
- - !ruby/object:Gem::Dependency
81
- name: nokogiri
82
- requirement: &2153568540 !ruby/object:Gem::Requirement
114
+ type: :runtime
115
+ requirement: &id007 !ruby/object:Gem::Requirement
83
116
  none: false
84
- requirements:
85
- - - ! '>='
86
- - !ruby/object:Gem::Version
117
+ requirements:
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ hash: 7
121
+ segments:
122
+ - 1
123
+ - 4
124
+ - 0
87
125
  version: 1.4.0
88
- type: :runtime
126
+ version_requirements: *id007
127
+ name: nokogiri
128
+ - !ruby/object:Gem::Dependency
89
129
  prerelease: false
90
- version_requirements: *2153568540
91
- - !ruby/object:Gem::Dependency
92
- name: rake
93
- requirement: &2153568060 !ruby/object:Gem::Requirement
130
+ type: :development
131
+ requirement: &id008 !ruby/object:Gem::Requirement
94
132
  none: false
95
- requirements:
133
+ requirements:
96
134
  - - ~>
97
- - !ruby/object:Gem::Version
135
+ - !ruby/object:Gem::Version
136
+ hash: 49
137
+ segments:
138
+ - 0
139
+ - 8
140
+ - 7
98
141
  version: 0.8.7
99
- type: :development
142
+ version_requirements: *id008
143
+ name: rake
144
+ - !ruby/object:Gem::Dependency
100
145
  prerelease: false
101
- version_requirements: *2153568060
102
- - !ruby/object:Gem::Dependency
103
- name: rspec
104
- requirement: &2153567600 !ruby/object:Gem::Requirement
146
+ type: :development
147
+ requirement: &id009 !ruby/object:Gem::Requirement
105
148
  none: false
106
- requirements:
149
+ requirements:
107
150
  - - ~>
108
- - !ruby/object:Gem::Version
151
+ - !ruby/object:Gem::Version
152
+ hash: 27
153
+ segments:
154
+ - 2
155
+ - 5
156
+ - 0
109
157
  version: 2.5.0
110
- type: :development
158
+ version_requirements: *id009
159
+ name: rspec
160
+ - !ruby/object:Gem::Dependency
111
161
  prerelease: false
112
- version_requirements: *2153567600
113
- - !ruby/object:Gem::Dependency
114
- name: mocha
115
- requirement: &2153583300 !ruby/object:Gem::Requirement
162
+ type: :development
163
+ requirement: &id010 !ruby/object:Gem::Requirement
116
164
  none: false
117
- requirements:
165
+ requirements:
118
166
  - - ~>
119
- - !ruby/object:Gem::Version
167
+ - !ruby/object:Gem::Version
168
+ hash: 43
169
+ segments:
170
+ - 0
171
+ - 9
172
+ - 8
120
173
  version: 0.9.8
121
- type: :development
174
+ version_requirements: *id010
175
+ name: mocha
176
+ - !ruby/object:Gem::Dependency
122
177
  prerelease: false
123
- version_requirements: *2153583300
124
- - !ruby/object:Gem::Dependency
125
- name: timecop
126
- requirement: &2153582600 !ruby/object:Gem::Requirement
178
+ type: :development
179
+ requirement: &id011 !ruby/object:Gem::Requirement
127
180
  none: false
128
- requirements:
181
+ requirements:
129
182
  - - ~>
130
- - !ruby/object:Gem::Version
183
+ - !ruby/object:Gem::Version
184
+ hash: 25
185
+ segments:
186
+ - 0
187
+ - 3
188
+ - 5
131
189
  version: 0.3.5
132
- type: :development
190
+ version_requirements: *id011
191
+ name: timecop
192
+ - !ruby/object:Gem::Dependency
133
193
  prerelease: false
134
- version_requirements: *2153582600
135
- - !ruby/object:Gem::Dependency
136
- name: autotest
137
- requirement: &2153582140 !ruby/object:Gem::Requirement
138
- none: false
139
- requirements:
140
- - - ! '>='
141
- - !ruby/object:Gem::Version
142
- version: '0'
143
194
  type: :development
195
+ requirement: &id012 !ruby/object:Gem::Requirement
196
+ none: false
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ hash: 3
201
+ segments:
202
+ - 0
203
+ version: "0"
204
+ version_requirements: *id012
205
+ name: autotest
206
+ - !ruby/object:Gem::Dependency
144
207
  prerelease: false
145
- version_requirements: *2153582140
146
- - !ruby/object:Gem::Dependency
147
- name: ZenTest
148
- requirement: &2153581320 !ruby/object:Gem::Requirement
208
+ type: :development
209
+ requirement: &id013 !ruby/object:Gem::Requirement
149
210
  none: false
150
- requirements:
151
- - - =
152
- - !ruby/object:Gem::Version
211
+ requirements:
212
+ - - "="
213
+ - !ruby/object:Gem::Version
214
+ hash: 43
215
+ segments:
216
+ - 4
217
+ - 5
218
+ - 0
153
219
  version: 4.5.0
154
- type: :development
155
- prerelease: false
156
- version_requirements: *2153581320
220
+ version_requirements: *id013
221
+ name: ZenTest
157
222
  description: Ruby's heavy metal SOAP client
158
223
  email: me@rubiii.com
159
224
  executables: []
225
+
160
226
  extensions: []
227
+
161
228
  extra_rdoc_files: []
162
- files:
229
+
230
+ files:
163
231
  - .gitignore
164
232
  - .rspec
165
233
  - .travis.yml
@@ -219,32 +287,36 @@ files:
219
287
  - spec/support/fixture.rb
220
288
  homepage: http://savonrb.com
221
289
  licenses: []
290
+
222
291
  post_install_message:
223
292
  rdoc_options: []
224
- require_paths:
293
+
294
+ require_paths:
225
295
  - lib
226
- required_ruby_version: !ruby/object:Gem::Requirement
296
+ required_ruby_version: !ruby/object:Gem::Requirement
227
297
  none: false
228
- requirements:
229
- - - ! '>='
230
- - !ruby/object:Gem::Version
231
- version: '0'
232
- segments:
298
+ requirements:
299
+ - - ">="
300
+ - !ruby/object:Gem::Version
301
+ hash: 3
302
+ segments:
233
303
  - 0
234
- hash: 391962510590924120
235
- required_rubygems_version: !ruby/object:Gem::Requirement
304
+ version: "0"
305
+ required_rubygems_version: !ruby/object:Gem::Requirement
236
306
  none: false
237
- requirements:
238
- - - ! '>='
239
- - !ruby/object:Gem::Version
240
- version: '0'
241
- segments:
307
+ requirements:
308
+ - - ">="
309
+ - !ruby/object:Gem::Version
310
+ hash: 3
311
+ segments:
242
312
  - 0
243
- hash: 391962510590924120
313
+ version: "0"
244
314
  requirements: []
315
+
245
316
  rubyforge_project: savon
246
317
  rubygems_version: 1.8.10
247
318
  signing_key:
248
319
  specification_version: 3
249
320
  summary: Heavy metal Ruby SOAP client
250
321
  test_files: []
322
+