savon 2.12.1 → 2.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/CHANGELOG.md +91 -73
- data/CONTRIBUTING.md +15 -19
- data/Gemfile +2 -7
- data/README.md +15 -19
- data/RELEASING.md +10 -0
- data/lib/savon/block_interface.rb +1 -0
- data/lib/savon/builder.rb +98 -29
- data/lib/savon/client.rb +1 -0
- data/lib/savon/core_ext/string.rb +1 -0
- data/lib/savon/header.rb +2 -6
- data/lib/savon/http_error.rb +4 -4
- data/lib/savon/log_message.rb +1 -0
- data/lib/savon/message.rb +1 -0
- data/lib/savon/mock/expectation.rb +1 -0
- data/lib/savon/mock/spec_helper.rb +1 -0
- data/lib/savon/mock.rb +1 -0
- data/lib/savon/model.rb +1 -0
- data/lib/savon/operation.rb +20 -18
- data/lib/savon/options.rb +56 -0
- data/lib/savon/qualified_message.rb +3 -2
- data/lib/savon/request.rb +5 -0
- data/lib/savon/request_logger.rb +8 -2
- data/lib/savon/response.rb +48 -1
- data/lib/savon/soap_fault.rb +1 -0
- data/lib/savon/version.rb +2 -1
- data/lib/savon.rb +1 -0
- data/savon.gemspec +9 -8
- data/spec/integration/support/application.rb +33 -1
- data/spec/integration/support/server.rb +1 -0
- data/spec/integration/zipcode_example_spec.rb +5 -8
- data/spec/savon/builder_spec.rb +2 -1
- data/spec/savon/client_spec.rb +5 -4
- data/spec/savon/core_ext/string_spec.rb +2 -1
- data/spec/savon/features/message_tag_spec.rb +2 -1
- data/spec/savon/http_error_spec.rb +9 -1
- data/spec/savon/log_message_spec.rb +2 -1
- data/spec/savon/message_spec.rb +2 -11
- data/spec/savon/mock_spec.rb +2 -1
- data/spec/savon/model_spec.rb +2 -1
- data/spec/savon/multipart_request_spec.rb +46 -0
- data/spec/savon/observers_spec.rb +2 -1
- data/spec/savon/operation_spec.rb +20 -43
- data/spec/savon/options_spec.rb +40 -1
- data/spec/savon/qualified_message_spec.rb +2 -1
- data/spec/savon/request_logger_spec.rb +2 -1
- data/spec/savon/request_spec.rb +47 -6
- data/spec/savon/response_spec.rb +2 -1
- data/spec/savon/soap_fault_spec.rb +2 -1
- data/spec/savon/softlayer_spec.rb +17 -2
- data/spec/spec_helper.rb +5 -4
- data/spec/support/adapters.rb +1 -0
- data/spec/support/endpoint.rb +1 -0
- data/spec/support/fixture.rb +1 -0
- data/spec/support/integration.rb +1 -0
- data/spec/support/stdout.rb +1 -0
- metadata +55 -33
- data/.travis.yml +0 -26
- data/donate.png +0 -0
- data/spec/integration/centra_spec.rb +0 -67
- data/spec/integration/email_example_spec.rb +0 -32
- data/spec/integration/random_quote_spec.rb +0 -23
- data/spec/integration/ratp_example_spec.rb +0 -28
- data/spec/integration/stockquote_example_spec.rb +0 -34
- data/spec/integration/temperature_example_spec.rb +0 -46
data/spec/savon/request_spec.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "spec_helper"
|
2
3
|
require "integration/support/server"
|
3
4
|
|
4
|
-
describe Savon::WSDLRequest do
|
5
|
+
RSpec.describe Savon::WSDLRequest do
|
5
6
|
|
6
7
|
let(:globals) { Savon::GlobalOptions.new }
|
7
8
|
let(:http_request) { HTTPI::Request.new }
|
@@ -73,6 +74,20 @@ describe Savon::WSDLRequest do
|
|
73
74
|
end
|
74
75
|
end
|
75
76
|
|
77
|
+
describe "write timeout" do
|
78
|
+
it "is set when specified" do
|
79
|
+
globals.write_timeout(44)
|
80
|
+
http_request.expects(:write_timeout=).with(44)
|
81
|
+
|
82
|
+
new_wsdl_request.build
|
83
|
+
end
|
84
|
+
|
85
|
+
it "is not set otherwise" do
|
86
|
+
http_request.expects(:read_timeout=).never
|
87
|
+
new_wsdl_request.build
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
76
91
|
describe "ssl version" do
|
77
92
|
it "is set when specified" do
|
78
93
|
globals.ssl_version(:TLSv1)
|
@@ -87,6 +102,34 @@ describe Savon::WSDLRequest do
|
|
87
102
|
end
|
88
103
|
end
|
89
104
|
|
105
|
+
describe "ssl min_version" do
|
106
|
+
it "is set when specified" do
|
107
|
+
globals.ssl_min_version(:TLS1_2)
|
108
|
+
http_request.auth.ssl.expects(:min_version=).with(:TLS1_2)
|
109
|
+
|
110
|
+
new_wsdl_request.build
|
111
|
+
end
|
112
|
+
|
113
|
+
it "is not set otherwise" do
|
114
|
+
http_request.auth.ssl.expects(:min_version=).never
|
115
|
+
new_wsdl_request.build
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
describe "ssl max_version" do
|
120
|
+
it "is set when specified" do
|
121
|
+
globals.ssl_max_version(:TLS1_2)
|
122
|
+
http_request.auth.ssl.expects(:max_version=).with(:TLS1_2)
|
123
|
+
|
124
|
+
new_wsdl_request.build
|
125
|
+
end
|
126
|
+
|
127
|
+
it "is not set otherwise" do
|
128
|
+
http_request.auth.ssl.expects(:max_version=).never
|
129
|
+
new_wsdl_request.build
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
90
133
|
describe "ssl verify mode" do
|
91
134
|
it "is set when specified" do
|
92
135
|
globals.ssl_verify_mode(:peer)
|
@@ -148,6 +191,7 @@ describe Savon::WSDLRequest do
|
|
148
191
|
describe "ssl encrypted cert key file" do
|
149
192
|
describe "set with an invalid decrypting password" do
|
150
193
|
it "fails when attempting to use the SSL private key" do
|
194
|
+
skip("JRuby: find out why this does not raise an error!") if RUBY_PLATFORM == 'java'
|
151
195
|
pass = "wrong-password"
|
152
196
|
key = File.expand_path("../../fixtures/ssl/client_encrypted_key.pem", __FILE__)
|
153
197
|
cert = File.expand_path("../../fixtures/ssl/client_encrypted_key_cert.pem", __FILE__)
|
@@ -158,15 +202,12 @@ describe Savon::WSDLRequest do
|
|
158
202
|
|
159
203
|
new_wsdl_request.build
|
160
204
|
|
161
|
-
expect { http_request.auth.ssl.cert_key }.to raise_error
|
205
|
+
expect { http_request.auth.ssl.cert_key }.to raise_error OpenSSL::PKey::PKeyError
|
162
206
|
end
|
163
207
|
end
|
164
208
|
|
165
209
|
describe "set with a valid decrypting password" do
|
166
210
|
it "handles SSL private keys properly" do
|
167
|
-
if RUBY_ENGINE == 'jruby'
|
168
|
-
pending("find out why this fails with a null pointer exception on jruby")
|
169
|
-
end
|
170
211
|
pass = "secure-password!42"
|
171
212
|
key = File.expand_path("../../fixtures/ssl/client_encrypted_key.pem", __FILE__)
|
172
213
|
cert = File.expand_path("../../fixtures/ssl/client_encrypted_key_cert.pem", __FILE__)
|
@@ -257,7 +298,7 @@ describe Savon::WSDLRequest do
|
|
257
298
|
|
258
299
|
end
|
259
300
|
|
260
|
-
describe Savon::SOAPRequest do
|
301
|
+
RSpec.describe Savon::SOAPRequest do
|
261
302
|
|
262
303
|
let(:globals) { Savon::GlobalOptions.new }
|
263
304
|
let(:http_request) { HTTPI::Request.new }
|
data/spec/savon/response_spec.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "spec_helper"
|
2
3
|
|
3
|
-
describe Savon::SOAPFault do
|
4
|
+
RSpec.describe Savon::SOAPFault do
|
4
5
|
let(:soap_fault) { Savon::SOAPFault.new new_response(:body => Fixture.response(:soap_fault)), nori }
|
5
6
|
let(:empty_soap_fault) { Savon::SOAPFault.new new_response(:body => Fixture.response(:empty_soap_fault)), nori }
|
6
7
|
let(:soap_fault2) { Savon::SOAPFault.new new_response(:body => Fixture.response(:soap_fault12)), nori }
|
@@ -1,6 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "spec_helper"
|
2
3
|
|
3
|
-
describe Savon::Builder do
|
4
|
+
RSpec.describe Savon::Builder do
|
4
5
|
|
5
6
|
subject(:builder) { Savon::Builder.new(:create_object, wsdl, globals, locals) }
|
6
7
|
|
@@ -19,9 +20,23 @@ describe Savon::Builder do
|
|
19
20
|
}
|
20
21
|
}
|
21
22
|
|
23
|
+
expected_namespaces = {
|
24
|
+
'xmlns' => "http://schemas.xmlsoap.org/wsdl/",
|
25
|
+
'xmlns:xsd' => "http://www.w3.org/2001/XMLSchema",
|
26
|
+
'xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance",
|
27
|
+
'xmlns:tns' => "http://api.service.softlayer.com/soap/v3/",
|
28
|
+
'xmlns:env' => "http://schemas.xmlsoap.org/soap/envelope/",
|
29
|
+
'xmlns:soap' => "http://schemas.xmlsoap.org/wsdl/soap/",
|
30
|
+
'xmlns:soap-enc' => "http://schemas.xmlsoap.org/soap/encoding/",
|
31
|
+
'xmlns:wsdl' => "http://schemas.xmlsoap.org/wsdl/"
|
32
|
+
}
|
33
|
+
|
22
34
|
locals = Savon::LocalOptions.new(message)
|
23
35
|
builder = Savon::Builder.new(:create_object, wsdl, globals, locals)
|
24
|
-
|
36
|
+
|
37
|
+
envelope = Nokogiri::XML(builder.to_s).xpath('./env:Envelope').first
|
38
|
+
|
39
|
+
expect(envelope.namespaces).to match(expected_namespaces)
|
25
40
|
end
|
26
41
|
end
|
27
42
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "bundler"
|
3
|
+
require "byebug"
|
2
4
|
Bundler.setup(:default, :development)
|
3
5
|
|
4
6
|
unless RUBY_PLATFORM =~ /java/
|
5
7
|
require "simplecov"
|
6
|
-
require "coveralls"
|
7
|
-
|
8
|
-
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
|
9
8
|
SimpleCov.start do
|
10
9
|
add_filter "spec"
|
11
10
|
end
|
@@ -19,12 +18,14 @@ require "rspec"
|
|
19
18
|
require "httpclient"
|
20
19
|
|
21
20
|
support_files = File.expand_path("spec/support/**/*.rb")
|
22
|
-
Dir[support_files].each { |file| require file }
|
21
|
+
Dir[support_files].sort.each { |file| require file }
|
23
22
|
|
24
23
|
RSpec.configure do |config|
|
25
24
|
config.include SpecSupport
|
26
25
|
config.mock_with :mocha
|
27
26
|
config.order = "random"
|
27
|
+
config.example_status_persistence_file_path = ".rspec_status"
|
28
|
+
config.disable_monkey_patching!
|
28
29
|
end
|
29
30
|
|
30
31
|
HTTPI.log = false
|
data/spec/support/adapters.rb
CHANGED
data/spec/support/endpoint.rb
CHANGED
data/spec/support/fixture.rb
CHANGED
data/spec/support/integration.rb
CHANGED
data/spec/support/stdout.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: savon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Harrington
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nori
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: httpi
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 2.4.5
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 2.4.5
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: wasabi
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 1.8.1
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: mail
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '2.5'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '2.5'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: rack
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -126,44 +140,58 @@ dependencies:
|
|
126
140
|
name: puma
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
128
142
|
requirements:
|
129
|
-
- - "
|
143
|
+
- - ">="
|
130
144
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
145
|
+
version: 4.3.8
|
132
146
|
type: :development
|
133
147
|
prerelease: false
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
|
-
- - "
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 4.3.8
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: byebug
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
137
165
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
166
|
+
version: '0'
|
139
167
|
- !ruby/object:Gem::Dependency
|
140
168
|
name: rake
|
141
169
|
requirement: !ruby/object:Gem::Requirement
|
142
170
|
requirements:
|
143
|
-
- - "
|
171
|
+
- - ">="
|
144
172
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
173
|
+
version: 12.3.3
|
146
174
|
type: :development
|
147
175
|
prerelease: false
|
148
176
|
version_requirements: !ruby/object:Gem::Requirement
|
149
177
|
requirements:
|
150
|
-
- - "
|
178
|
+
- - ">="
|
151
179
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
180
|
+
version: 12.3.3
|
153
181
|
- !ruby/object:Gem::Dependency
|
154
182
|
name: rspec
|
155
183
|
requirement: !ruby/object:Gem::Requirement
|
156
184
|
requirements:
|
157
185
|
- - "~>"
|
158
186
|
- !ruby/object:Gem::Version
|
159
|
-
version: '
|
187
|
+
version: '3.9'
|
160
188
|
type: :development
|
161
189
|
prerelease: false
|
162
190
|
version_requirements: !ruby/object:Gem::Requirement
|
163
191
|
requirements:
|
164
192
|
- - "~>"
|
165
193
|
- !ruby/object:Gem::Version
|
166
|
-
version: '
|
194
|
+
version: '3.9'
|
167
195
|
- !ruby/object:Gem::Dependency
|
168
196
|
name: mocha
|
169
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -182,16 +210,16 @@ dependencies:
|
|
182
210
|
name: json
|
183
211
|
requirement: !ruby/object:Gem::Requirement
|
184
212
|
requirements:
|
185
|
-
- - "
|
213
|
+
- - ">="
|
186
214
|
- !ruby/object:Gem::Version
|
187
|
-
version:
|
215
|
+
version: 2.3.0
|
188
216
|
type: :development
|
189
217
|
prerelease: false
|
190
218
|
version_requirements: !ruby/object:Gem::Requirement
|
191
219
|
requirements:
|
192
|
-
- - "
|
220
|
+
- - ">="
|
193
221
|
- !ruby/object:Gem::Version
|
194
|
-
version:
|
222
|
+
version: 2.3.0
|
195
223
|
description: Heavy metal SOAP client
|
196
224
|
email: me@rubiii.com
|
197
225
|
executables: []
|
@@ -199,15 +227,14 @@ extensions: []
|
|
199
227
|
extra_rdoc_files: []
|
200
228
|
files:
|
201
229
|
- ".gitignore"
|
202
|
-
- ".travis.yml"
|
203
230
|
- ".yardopts"
|
204
231
|
- CHANGELOG.md
|
205
232
|
- CONTRIBUTING.md
|
206
233
|
- Gemfile
|
207
234
|
- LICENSE
|
208
235
|
- README.md
|
236
|
+
- RELEASING.md
|
209
237
|
- Rakefile
|
210
|
-
- donate.png
|
211
238
|
- lib/savon.rb
|
212
239
|
- lib/savon/block_interface.rb
|
213
240
|
- lib/savon/builder.rb
|
@@ -261,14 +288,8 @@ files:
|
|
261
288
|
- spec/fixtures/wsdl/team_software.xml
|
262
289
|
- spec/fixtures/wsdl/vies.xml
|
263
290
|
- spec/fixtures/wsdl/wasmuth.xml
|
264
|
-
- spec/integration/centra_spec.rb
|
265
|
-
- spec/integration/email_example_spec.rb
|
266
|
-
- spec/integration/random_quote_spec.rb
|
267
|
-
- spec/integration/ratp_example_spec.rb
|
268
|
-
- spec/integration/stockquote_example_spec.rb
|
269
291
|
- spec/integration/support/application.rb
|
270
292
|
- spec/integration/support/server.rb
|
271
|
-
- spec/integration/temperature_example_spec.rb
|
272
293
|
- spec/integration/zipcode_example_spec.rb
|
273
294
|
- spec/savon/builder_spec.rb
|
274
295
|
- spec/savon/client_spec.rb
|
@@ -279,6 +300,7 @@ files:
|
|
279
300
|
- spec/savon/message_spec.rb
|
280
301
|
- spec/savon/mock_spec.rb
|
281
302
|
- spec/savon/model_spec.rb
|
303
|
+
- spec/savon/multipart_request_spec.rb
|
282
304
|
- spec/savon/observers_spec.rb
|
283
305
|
- spec/savon/operation_spec.rb
|
284
306
|
- spec/savon/options_spec.rb
|
@@ -298,7 +320,7 @@ homepage: http://savonrb.com
|
|
298
320
|
licenses:
|
299
321
|
- MIT
|
300
322
|
metadata: {}
|
301
|
-
post_install_message:
|
323
|
+
post_install_message:
|
302
324
|
rdoc_options: []
|
303
325
|
require_paths:
|
304
326
|
- lib
|
@@ -306,15 +328,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
306
328
|
requirements:
|
307
329
|
- - ">="
|
308
330
|
- !ruby/object:Gem::Version
|
309
|
-
version:
|
331
|
+
version: 2.7.0
|
310
332
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
311
333
|
requirements:
|
312
334
|
- - ">="
|
313
335
|
- !ruby/object:Gem::Version
|
314
336
|
version: '0'
|
315
337
|
requirements: []
|
316
|
-
rubygems_version: 3.
|
317
|
-
signing_key:
|
338
|
+
rubygems_version: 3.3.7
|
339
|
+
signing_key:
|
318
340
|
specification_version: 4
|
319
341
|
summary: Heavy metal SOAP client
|
320
342
|
test_files: []
|
data/.travis.yml
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
# https://github.com/travis-ci/travis-ci/wiki/.travis.yml-options
|
2
|
-
language: "ruby"
|
3
|
-
|
4
|
-
script: "bundle exec rake --trace"
|
5
|
-
|
6
|
-
rvm:
|
7
|
-
- "2.5"
|
8
|
-
- "2.6"
|
9
|
-
- "2.7"
|
10
|
-
|
11
|
-
matrix:
|
12
|
-
include:
|
13
|
-
- name: "JRuby 9.2"
|
14
|
-
rvm: jruby-9.2.12.0
|
15
|
-
jdk: openjdk11
|
16
|
-
env: JAVA_OPTS="--add-opens java.base/java.security.cert=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED"
|
17
|
-
- name: Rubinius
|
18
|
-
rvm: rbx-4
|
19
|
-
dist: trusty
|
20
|
-
allow_failures:
|
21
|
-
- name: Rubinius
|
22
|
-
- name: "JRuby 9.2"
|
23
|
-
fast_finish: true
|
24
|
-
|
25
|
-
notifications:
|
26
|
-
irc: "irc.freenode.org#savon"
|
data/donate.png
DELETED
Binary file
|
@@ -1,67 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module LogInterceptor
|
4
|
-
@@intercepted_request = ""
|
5
|
-
def self.debug(message = nil)
|
6
|
-
message ||= yield if block_given?
|
7
|
-
|
8
|
-
# save only the first XMLly message
|
9
|
-
if message.include? "xml version"
|
10
|
-
@@intercepted_request = message if @@intercepted_request == ""
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.info(message = nil)
|
15
|
-
end
|
16
|
-
|
17
|
-
def self.get_intercepted_request
|
18
|
-
@@intercepted_request
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.reset_intercepted_request
|
22
|
-
@@intercepted_request = ""
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
describe 'Correct translation of attributes to XML' do
|
27
|
-
it "new :@attr syntax: correctly maps a Ruby Hash to XML attributes" do
|
28
|
-
LogInterceptor.reset_intercepted_request
|
29
|
-
|
30
|
-
client = Savon.client(
|
31
|
-
:wsdl => "http://mt205.sabameeting.com/CWS/CWS.asmx?WSDL",
|
32
|
-
:log => true,
|
33
|
-
:logger => LogInterceptor
|
34
|
-
)
|
35
|
-
|
36
|
-
response = nil
|
37
|
-
begin
|
38
|
-
response = call_and_fail_gracefully(client, :add_new_user, :message => { :user => { :@userID => "test" } })
|
39
|
-
rescue
|
40
|
-
end
|
41
|
-
|
42
|
-
xml_doc = Nokogiri::XML(LogInterceptor.get_intercepted_request)
|
43
|
-
xml_doc.remove_namespaces!
|
44
|
-
|
45
|
-
attributes_element_not_present = xml_doc.xpath("//AddNewUser/attributes").blank?
|
46
|
-
expect(attributes_element_not_present).to eq true
|
47
|
-
end
|
48
|
-
|
49
|
-
it "old :attributes! syntax: correctly maps a Ruby Hash to XML attributes" do
|
50
|
-
LogInterceptor.reset_intercepted_request
|
51
|
-
|
52
|
-
client = Savon.client(
|
53
|
-
:wsdl => "http://mt205.sabameeting.com/CWS/CWS.asmx?WSDL",
|
54
|
-
:log => true,
|
55
|
-
:logger => LogInterceptor
|
56
|
-
)
|
57
|
-
|
58
|
-
response = nil
|
59
|
-
response = call_and_fail_gracefully(client, :add_new_user, :message => { :user => {}, :attributes! => { :user => { :userID => "test" } } })
|
60
|
-
|
61
|
-
xml_doc = Nokogiri::XML(LogInterceptor.get_intercepted_request)
|
62
|
-
xml_doc.remove_namespaces!
|
63
|
-
|
64
|
-
attributes_element_not_present = xml_doc.xpath("//AddNewUser/attributes").blank?
|
65
|
-
expect(attributes_element_not_present).to eq true
|
66
|
-
end
|
67
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "Email example" do
|
4
|
-
|
5
|
-
it "passes Strings as they are" do
|
6
|
-
client = Savon.client(
|
7
|
-
# The WSDL document provided by the service.
|
8
|
-
:wsdl => "http://ws.cdyne.com/emailverify/Emailvernotestemail.asmx?wsdl",
|
9
|
-
|
10
|
-
# Lower timeouts so these specs don't take forever when the service is not available.
|
11
|
-
:open_timeout => 10,
|
12
|
-
:read_timeout => 10,
|
13
|
-
|
14
|
-
# Disable logging for cleaner spec output.
|
15
|
-
:log => false
|
16
|
-
)
|
17
|
-
|
18
|
-
response = call_and_fail_gracefully(client, :verify_email, :message => { :email => "soap@example.com", "LicenseKey" => "?" })
|
19
|
-
|
20
|
-
response_text = response.body[:verify_email_response][:verify_email_result][:response_text]
|
21
|
-
|
22
|
-
if response_text == "Current license key only allows so many checks"
|
23
|
-
# Fallback to not fail the specs when the service's API limit is reached,
|
24
|
-
# but to mark the spec as pending instead.
|
25
|
-
pending "API limit exceeded"
|
26
|
-
else
|
27
|
-
# The expected result. We unfortunately don't have a license key for this service.
|
28
|
-
expect(response_text).to eq("Email Domain Not Found")
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'rpc/encoded binding test' do
|
4
|
-
|
5
|
-
it 'should should work with WSDLs that have rpc/encoded SOAP binding' do
|
6
|
-
client = Savon.client(
|
7
|
-
:wsdl => "http://www.boyzoid.com/comp/randomQuote.cfc?wsdl",
|
8
|
-
:open_timeout => 10,
|
9
|
-
:read_timeout => 10,
|
10
|
-
:log => false
|
11
|
-
)
|
12
|
-
|
13
|
-
begin
|
14
|
-
client.call(:get_quote)
|
15
|
-
rescue Savon::SOAPFault => e
|
16
|
-
$stderr.puts e.to_hash.inspect
|
17
|
-
f_c = e.to_hash[:fault][:faultstring]
|
18
|
-
expect(f_c).not_to eq('No such operation \'getQuoteRequest\'')
|
19
|
-
expect(f_c).to eq('lucee.runtime.exp.DatabaseException: ')
|
20
|
-
pending e
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "RATP example" do
|
4
|
-
|
5
|
-
it "retrieves information about a specific station" do
|
6
|
-
client = Savon.client do
|
7
|
-
# The WSDL document provided by the service.
|
8
|
-
wsdl "http://www.ratp.fr/wsiv/services/Wsiv?wsdl"
|
9
|
-
|
10
|
-
# Lower timeouts so these specs don't take forever when the service is not available.
|
11
|
-
open_timeout 10
|
12
|
-
read_timeout 10
|
13
|
-
|
14
|
-
# Disable logging for cleaner spec output.
|
15
|
-
log false
|
16
|
-
end
|
17
|
-
|
18
|
-
# XXX: the service seems to rely on the order of arguments.
|
19
|
-
# try to fix this with the new wsdl parser.
|
20
|
-
response = call_and_fail_gracefully(client, :get_stations) do
|
21
|
-
message(:station => { :id => 1975 }, :limit => 1)
|
22
|
-
end
|
23
|
-
|
24
|
-
station_name = response.body[:get_stations_response][:return][:stations][:name]
|
25
|
-
expect(station_name).to eq("Cite")
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "Stockquote example" do
|
4
|
-
|
5
|
-
it "returns the result in a CDATA tag" do
|
6
|
-
client = Savon.client(
|
7
|
-
# The WSDL document provided by the service.
|
8
|
-
:wsdl => "http://www.webservicex.net/stockquote.asmx?WSDL",
|
9
|
-
|
10
|
-
# Lower timeouts so these specs don't take forever when the service is not available.
|
11
|
-
:open_timeout => 10,
|
12
|
-
:read_timeout => 10,
|
13
|
-
|
14
|
-
# Disable logging for cleaner spec output.
|
15
|
-
:log => false
|
16
|
-
)
|
17
|
-
|
18
|
-
response = call_and_fail_gracefully(client, :get_quote, :message => { :symbol => "AAPL" })
|
19
|
-
|
20
|
-
cdata = response.body[:get_quote_response][:get_quote_result]
|
21
|
-
|
22
|
-
if cdata == "exception"
|
23
|
-
# Fallback to not fail the specs when the service's API limit is reached,
|
24
|
-
# but to mark the spec as pending instead.
|
25
|
-
pending "Exception on API"
|
26
|
-
end
|
27
|
-
|
28
|
-
nori_options = { :convert_tags_to => lambda { |tag| tag.snakecase.to_sym } }
|
29
|
-
result = Nori.new(nori_options).parse(cdata)
|
30
|
-
|
31
|
-
expect(result[:stock_quotes][:stock][:symbol]).to eq("AAPL")
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|