savon 2.11.0 → 2.12.0
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.
- checksums.yaml +4 -4
- data/.travis.yml +12 -4
- data/CHANGELOG.md +25 -0
- data/Gemfile +1 -7
- data/README.md +18 -5
- data/lib/savon/builder.rb +32 -6
- data/lib/savon/client.rb +1 -2
- data/lib/savon/header.rb +2 -2
- data/lib/savon/log_message.rb +1 -1
- data/lib/savon/mock/expectation.rb +11 -2
- data/lib/savon/operation.rb +9 -2
- data/lib/savon/options.rb +47 -18
- data/lib/savon/qualified_message.rb +28 -27
- data/lib/savon/request.rb +17 -6
- data/lib/savon/response.rb +7 -6
- data/lib/savon/soap_fault.rb +1 -3
- data/lib/savon/version.rb +1 -1
- data/savon.gemspec +2 -3
- data/spec/fixtures/response/no_body.xml +1 -0
- data/spec/fixtures/wsdl/brand.xml +624 -0
- data/spec/integration/centra_spec.rb +7 -6
- data/spec/integration/random_quote_spec.rb +1 -1
- data/spec/integration/stockquote_example_spec.rb +6 -0
- data/spec/integration/support/application.rb +1 -1
- data/spec/savon/builder_spec.rb +13 -4
- data/spec/savon/log_message_spec.rb +7 -1
- data/spec/savon/mock_spec.rb +11 -0
- data/spec/savon/options_spec.rb +54 -5
- data/spec/savon/qualified_message_spec.rb +86 -5
- data/spec/savon/request_spec.rb +52 -8
- data/spec/savon/response_spec.rb +5 -0
- data/spec/savon/soap_fault_spec.rb +5 -0
- data/spec/savon/softlayer_spec.rb +27 -0
- data/spec/support/integration.rb +1 -1
- metadata +12 -23
data/spec/savon/response_spec.rb
CHANGED
@@ -235,6 +235,11 @@ describe Savon::Response do
|
|
235
235
|
expect(result).to be_a(Hash)
|
236
236
|
expect(result.keys).to include(:authentication_value)
|
237
237
|
end
|
238
|
+
|
239
|
+
it 'fails correctly when envelope contains only string' do
|
240
|
+
response = soap_response({ :body => Fixture.response(:no_body) })
|
241
|
+
expect { response.find('Body') }.to raise_error Savon::InvalidResponseError
|
242
|
+
end
|
238
243
|
end
|
239
244
|
|
240
245
|
describe "#http" do
|
@@ -7,6 +7,7 @@ describe Savon::SOAPFault do
|
|
7
7
|
let(:soap_fault_nc) { Savon::SOAPFault.new new_response(:body => Fixture.response(:soap_fault)), nori_no_convert }
|
8
8
|
let(:soap_fault_nc2) { Savon::SOAPFault.new new_response(:body => Fixture.response(:soap_fault12)), nori_no_convert }
|
9
9
|
let(:another_soap_fault) { Savon::SOAPFault.new new_response(:body => Fixture.response(:another_soap_fault)), nori }
|
10
|
+
let(:soap_fault_no_body) { Savon::SOAPFault.new new_response(:body => {}), nori }
|
10
11
|
let(:no_fault) { Savon::SOAPFault.new new_response, nori }
|
11
12
|
|
12
13
|
let(:nori) { Nori.new(:strip_namespaces => true, :convert_tags_to => lambda { |tag| tag.snakecase.to_sym }) }
|
@@ -119,6 +120,10 @@ describe Savon::SOAPFault do
|
|
119
120
|
|
120
121
|
expect(soap_fault_nc2.to_hash).to eq(expected)
|
121
122
|
end
|
123
|
+
|
124
|
+
it "returns empty hash" do
|
125
|
+
expect(soap_fault_no_body.to_hash).to eq({})
|
126
|
+
end
|
122
127
|
end
|
123
128
|
|
124
129
|
def new_response(options = {})
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Savon::Builder do
|
4
|
+
|
5
|
+
subject(:builder) { Savon::Builder.new(:create_object, wsdl, globals, locals) }
|
6
|
+
|
7
|
+
let(:globals) { Savon::GlobalOptions.new }
|
8
|
+
# let(:locals) { Savon::LocalOptions.new }
|
9
|
+
let(:wsdl) { Wasabi::Document.new Fixture.wsdl(:brand) }
|
10
|
+
let(:no_wsdl) { Wasabi::Document.new }
|
11
|
+
|
12
|
+
describe "#to_s" do
|
13
|
+
it "defaults to include the default envelope namespace of :env" do
|
14
|
+
message = {
|
15
|
+
:message=>{
|
16
|
+
:template_object=>{
|
17
|
+
:longName=>"Zertico LLC Reseller"
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
locals = Savon::LocalOptions.new(message)
|
23
|
+
builder = Savon::Builder.new(:create_object, wsdl, globals, locals)
|
24
|
+
expect(builder.to_s).to eq('<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://api.service.softlayer.com/soap/v3/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><tns:createObject><templateObject><longName>Zertico LLC Reseller</longName></templateObject></tns:createObject></env:Body></env:Envelope>')
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/spec/support/integration.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.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Harrington
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nori
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.2'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: uuid
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 2.3.7
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: 2.3.7
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: builder
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,14 +100,14 @@ dependencies:
|
|
114
100
|
requirements:
|
115
101
|
- - ">="
|
116
102
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.
|
103
|
+
version: 1.8.1
|
118
104
|
type: :runtime
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
107
|
requirements:
|
122
108
|
- - ">="
|
123
109
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.
|
110
|
+
version: 1.8.1
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
112
|
name: rack
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,16 +126,16 @@ dependencies:
|
|
140
126
|
name: puma
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
142
128
|
requirements:
|
143
|
-
- -
|
129
|
+
- - "~>"
|
144
130
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
131
|
+
version: '3.0'
|
146
132
|
type: :development
|
147
133
|
prerelease: false
|
148
134
|
version_requirements: !ruby/object:Gem::Requirement
|
149
135
|
requirements:
|
150
|
-
- -
|
136
|
+
- - "~>"
|
151
137
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
138
|
+
version: '3.0'
|
153
139
|
- !ruby/object:Gem::Dependency
|
154
140
|
name: rake
|
155
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -251,6 +237,7 @@ files:
|
|
251
237
|
- spec/fixtures/response/header.xml
|
252
238
|
- spec/fixtures/response/list.xml
|
253
239
|
- spec/fixtures/response/multi_ref.xml
|
240
|
+
- spec/fixtures/response/no_body.xml
|
254
241
|
- spec/fixtures/response/soap_fault.xml
|
255
242
|
- spec/fixtures/response/soap_fault12.xml
|
256
243
|
- spec/fixtures/response/soap_fault_funky.xml
|
@@ -261,6 +248,7 @@ files:
|
|
261
248
|
- spec/fixtures/ssl/client_key.pem
|
262
249
|
- spec/fixtures/wsdl/authentication.xml
|
263
250
|
- spec/fixtures/wsdl/betfair.xml
|
251
|
+
- spec/fixtures/wsdl/brand.xml
|
264
252
|
- spec/fixtures/wsdl/edialog.xml
|
265
253
|
- spec/fixtures/wsdl/interhome.xml
|
266
254
|
- spec/fixtures/wsdl/lower_camel.xml
|
@@ -297,6 +285,7 @@ files:
|
|
297
285
|
- spec/savon/request_spec.rb
|
298
286
|
- spec/savon/response_spec.rb
|
299
287
|
- spec/savon/soap_fault_spec.rb
|
288
|
+
- spec/savon/softlayer_spec.rb
|
300
289
|
- spec/spec_helper.rb
|
301
290
|
- spec/support/adapters.rb
|
302
291
|
- spec/support/endpoint.rb
|
@@ -323,7 +312,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
323
312
|
version: '0'
|
324
313
|
requirements: []
|
325
314
|
rubyforge_project: savon
|
326
|
-
rubygems_version: 2.
|
315
|
+
rubygems_version: 2.6.13
|
327
316
|
signing_key:
|
328
317
|
specification_version: 4
|
329
318
|
summary: Heavy metal SOAP client
|