savon 2.15.1 → 2.16.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df435a9b3a37060f3dbbfe5ba2f8b36c33ad66b6474afa08771396b6812fb4b3
4
- data.tar.gz: ac8cccabad1588894528b1d2ad073e576224a6b4a5b25d10a0437fb5a807e538
3
+ metadata.gz: 31b29512f6e1e259e34f95ef7cc0d38dd9ac8911d0b1307ca05bf69736985cbb
4
+ data.tar.gz: 3ae386e5a8ade343d99e7dc10d644499cf5315fc51d058a8e3f7cb103ad25872
5
5
  SHA512:
6
- metadata.gz: 79a1dd54bd1d171afc117927c9b5419f7c6d2e2a5e2b1cfad0072397e786f5932bb3180b40f7ea9d55a08194c1554afddf3efe558959157cdcc7e8b13243beb9
7
- data.tar.gz: 9e9f944a60f6f655da4abfed31020befb23a9823bb3437ccb46e527b1b8e091fac81c776fc3057f88985a80bbae3c8bb9746bf8c1e9c3966ac8992bc0ee7f936
6
+ metadata.gz: e18a7a8ee40adfab9ab7e316abce340251ef30ad93dd50348640488a282aa5a462d16b46fd987414747c4efe76a04b68ec3e0e50d95de77ac331c4a630549182
7
+ data.tar.gz: 686fc36d67eb071a75ce201d16ec4ba3be443c23c48db90f87ee3bece8d76f05f81768acbc182fa32ffbf1623d022d9ca3b23871aa68c8b86c6ca6bd82df049a
data/CHANGELOG.md CHANGED
@@ -1,7 +1,17 @@
1
1
  # Savon changelog
2
2
 
3
- ## Unreleased
4
- * Add your PR changelog line here
3
+ ## 2.16.0 (2026-05-18)
4
+
5
+ **Restore compatibility**
6
+
7
+ If you stayed on 2.12.1 because a later version broke something, this release is for you. The fixes below target the most commonly reported upgrade blockers. Existing code should work without modification.
8
+
9
+ * Fix: Restore `Savon::Response#hash` removed in 2.14.0 (#985). Callers on 2.12.1 that use `response.hash` get the soap body back instead of Ruby's integer object id. A deprecation warning is emitted on each call. Use `#full_hash` going forward.
10
+ * Fix: Require wasabi >= 5.1.0 (#1015, #1016). Wasabi 4.x used message names as soap body element names and SOAPAction header values instead of operation names (savonrb/wasabi#122), causing servers to return a fault or reject the action for operations whose message name carried an `In` suffix.
11
+ * Fix: Stop dumping all WSDL namespaces into every soap envelope (#1014, #942). 2.13.0 injected every namespace from the entire WSDL document into each request, including structural ones that have no place in a request body. Strict servers reject envelopes with unexpected or duplicate declarations.
12
+ * Fix: Raise a proper `SOAPFault` instead of a raw exception when `soap:Fault` contains invalid encoding (#923).
13
+ * Fix: `SOAPFault.present?` was ignoring its `xml` argument and always operating on the instance's own body.
14
+ * Change: Added Ruby 3.4 (#1024) and Ruby 4.0 (#1039) to the CI test matrix.
5
15
 
6
16
  ## 2.15.1 (2024-07-08)
7
17
 
data/README.md CHANGED
@@ -3,11 +3,10 @@
3
3
  Heavy metal SOAP client
4
4
 
5
5
  [Documentation](https://www.rubydoc.info/gems/savon/) | [Support](https://stackoverflow.com/questions/tagged/savon) |
6
- [Mailing list](https://groups.google.com/forum/#!forum/savonrb) | [Twitter](http://twitter.com/savonrb)
6
+ [Mailing list](https://groups.google.com/forum/#!forum/savonrb)
7
7
 
8
8
  [![Ruby](https://github.com/savonrb/savon/actions/workflows/ci.yml/badge.svg)](https://github.com/savonrb/savon/actions/workflows/ci.yml)
9
9
  [![Gem Version](https://badge.fury.io/rb/savon.svg)](http://badge.fury.io/rb/savon)
10
- [![Code Climate](https://codeclimate.com/github/savonrb/savon.svg)](https://codeclimate.com/github/savonrb/savon)
11
10
  [![Coverage Status](https://coveralls.io/repos/savonrb/savon/badge.svg)](https://coveralls.io/r/savonrb/savon)
12
11
 
13
12
 
data/lib/savon/builder.rb CHANGED
@@ -95,9 +95,13 @@ module Savon
95
95
  @internal_namespace_count ||= 0
96
96
 
97
97
  unless identifier = namespace_by_uri(uri)
98
- identifier = "ins#{@internal_namespace_count}"
98
+ wsdl_identifier = @wsdl.document? ? @wsdl.parser.namespaces.key(uri) : nil
99
+ # The prefix may already be taken by the target namespace or a user-supplied
100
+ # :namespaces override - fall back to ins0, ins1... rather than overwriting it.
101
+ wsdl_identifier = nil if wsdl_identifier && namespaces.key?("xmlns:#{wsdl_identifier}")
102
+ identifier = wsdl_identifier || "ins#{@internal_namespace_count}"
99
103
  namespaces["xmlns:#{identifier}"] = uri
100
- @internal_namespace_count += 1
104
+ @internal_namespace_count += 1 unless wsdl_identifier
101
105
  end
102
106
 
103
107
  [path, identifier]
@@ -119,18 +123,6 @@ module Savon
119
123
  namespaces["xmlns#{env_namespace && env_namespace != "" ? ":#{env_namespace}" : ''}"] =
120
124
  SOAP_NAMESPACE[@globals[:soap_version]]
121
125
 
122
- if @wsdl&.document
123
- @wsdl.parser.namespaces.each do |identifier, path|
124
- next if identifier == 'xmlns' # Do not include xmlns namespace as this causes issues for some servers (https://github.com/savonrb/savon/issues/986)
125
-
126
- prefixed_identifier = "xmlns:#{identifier}"
127
-
128
- next if namespaces.key?(prefixed_identifier)
129
-
130
- namespaces[prefixed_identifier] = path
131
- end
132
- end
133
-
134
126
  namespaces
135
127
  end
136
128
  end
@@ -54,6 +54,11 @@ module Savon
54
54
  result.kind_of?(Array) ? result.compact : [result].compact
55
55
  end
56
56
 
57
+ def hash
58
+ warn "Savon::Response#hash is deprecated and will be removed in version 3 - use #full_hash instead", uplevel: 1
59
+ full_hash
60
+ end
61
+
57
62
  def full_hash
58
63
  @full_hash ||= nori.parse(xml)
59
64
  end
@@ -3,10 +3,11 @@ module Savon
3
3
  class SOAPFault < Error
4
4
 
5
5
  def self.present?(http, xml = nil)
6
- xml ||= http.body
7
- fault_node = xml.include?("Fault>")
8
- soap1_fault = xml.match(/faultcode\/?\>/) && xml.match(/faultstring\/?\>/)
9
- soap2_fault = xml.include?("Code>") && xml.include?("Reason>")
6
+ body = xml || http.body
7
+ body = body.scrub('') unless body.valid_encoding?
8
+ fault_node = body.include?("Fault>")
9
+ soap1_fault = body.match(/faultcode\/?\>/) && body.match(/faultstring\/?\>/)
10
+ soap2_fault = body.include?("Code>") && body.include?("Reason>")
10
11
 
11
12
  fault_node && (soap1_fault || soap2_fault)
12
13
  end
data/lib/savon/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Savon
3
- VERSION = '2.15.1'
3
+ VERSION = '2.16.0'
4
4
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: savon
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.15.1
4
+ version: 2.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Harrington
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-07-08 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: nori
@@ -50,7 +49,7 @@ dependencies:
50
49
  requirements:
51
50
  - - ">="
52
51
  - !ruby/object:Gem::Version
53
- version: '3.7'
52
+ version: 5.1.0
54
53
  - - "<"
55
54
  - !ruby/object:Gem::Version
56
55
  version: '6'
@@ -60,7 +59,7 @@ dependencies:
60
59
  requirements:
61
60
  - - ">="
62
61
  - !ruby/object:Gem::Version
63
- version: '3.7'
62
+ version: 5.1.0
64
63
  - - "<"
65
64
  - !ruby/object:Gem::Version
66
65
  version: '6'
@@ -168,6 +167,20 @@ dependencies:
168
167
  - - "<"
169
168
  - !ruby/object:Gem::Version
170
169
  version: '7'
170
+ - !ruby/object:Gem::Dependency
171
+ name: ostruct
172
+ requirement: !ruby/object:Gem::Requirement
173
+ requirements:
174
+ - - "~>"
175
+ - !ruby/object:Gem::Version
176
+ version: '0.6'
177
+ type: :development
178
+ prerelease: false
179
+ version_requirements: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - "~>"
182
+ - !ruby/object:Gem::Version
183
+ version: '0.6'
171
184
  - !ruby/object:Gem::Dependency
172
185
  name: byebug
173
186
  requirement: !ruby/object:Gem::Requirement
@@ -269,12 +282,11 @@ files:
269
282
  - lib/savon/soap_fault.rb
270
283
  - lib/savon/string_utils.rb
271
284
  - lib/savon/version.rb
272
- homepage: http://savonrb.com
285
+ homepage: https://savonrb.com
273
286
  licenses:
274
287
  - MIT
275
288
  metadata:
276
289
  rubygems_mfa_required: 'true'
277
- post_install_message:
278
290
  rdoc_options: []
279
291
  require_paths:
280
292
  - lib
@@ -289,8 +301,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
289
301
  - !ruby/object:Gem::Version
290
302
  version: '0'
291
303
  requirements: []
292
- rubygems_version: 3.5.6
293
- signing_key:
304
+ rubygems_version: 3.6.9
294
305
  specification_version: 4
295
306
  summary: Heavy metal SOAP client
296
307
  test_files: []