savon 0.8.6 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +42 -0
- data/README.md +2 -2
- data/lib/savon/client.rb +2 -2
- data/lib/savon/global.rb +16 -0
- data/lib/savon/soap/xml.rb +4 -3
- data/lib/savon/version.rb +1 -1
- data/savon.gemspec +2 -2
- data/spec/savon/soap/xml_spec.rb +7 -1
- metadata +9 -9
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,45 @@
|
|
1
|
+
## 0.9.0 (2011-04-05)
|
2
|
+
|
3
|
+
* Feature: issues [#158](https://github.com/rubiii/savon/issues/158),
|
4
|
+
[#169](https://github.com/rubiii/savon/issues/169) and [#172](https://github.com/rubiii/savon/issues/172)
|
5
|
+
configurable "Hash key Symbol to lowerCamelCase" conversion by using the latest version of
|
6
|
+
[Gyoku](http://rubygems.org/gems/gyoku).
|
7
|
+
|
8
|
+
Gyoku.convert_symbols_to(:camelcase)
|
9
|
+
Gyoku.xml(:first_name => "Mac") # => "<FirstName></Firstname>"
|
10
|
+
|
11
|
+
You can even define your own conversion formular.
|
12
|
+
|
13
|
+
Gyoku.convert_symbols_to { |key| key.upcase }
|
14
|
+
Gyoku.xml(:first_name => "Mac") # => "<FIRST_NAME></FIRST_NAME>"
|
15
|
+
|
16
|
+
This should also work for the SOAP input tag and SOAPAction header. So if you had to use a String for
|
17
|
+
the SOAP action to call because your services uses CamelCase instead of lowerCamelCase, you can now
|
18
|
+
change the default and use Symbols instead.
|
19
|
+
|
20
|
+
Gyoku.convert_symbols_to(:camelcase)
|
21
|
+
|
22
|
+
# pre Gyoku 0.4.0
|
23
|
+
client.request(:get_user) # => "<getUser/>"
|
24
|
+
client.request("GetUser") # => "<GetUser/>"
|
25
|
+
|
26
|
+
# post Gyoku 0.4.0
|
27
|
+
client.request(:get_user) # => "<GetUser/>"
|
28
|
+
|
29
|
+
* Improvement: issues [#170](https://github.com/rubiii/savon/issues/170) and
|
30
|
+
[#173](https://github.com/rubiii/savon/issues/173) Savon no longer rescues exceptions raised by
|
31
|
+
`Crack::XML.parse`. If Crack complains about your WSDL document, you should take control and
|
32
|
+
solve the problem instead of getting no response.
|
33
|
+
|
34
|
+
* Improvement: issue [#172](https://github.com/rubiii/savon/issues/172) support for global env_namespace.
|
35
|
+
|
36
|
+
Savon.configure do |config|
|
37
|
+
config.env_namespace = :soapenv # changes the default :env namespace
|
38
|
+
end
|
39
|
+
|
40
|
+
* Fix: [issue #163](https://github.com/rubiii/savon/issues/163) "Savon 0.8.6 not playing nicely
|
41
|
+
with Httpi 0.9.0". Updating HTTPI to v0.9.1 should solve this problem.
|
42
|
+
|
1
43
|
## 0.8.6 (2011-02-15)
|
2
44
|
|
3
45
|
* Fix for issues [issue #147](https://github.com/rubiii/savon/issues/147) and [#151](https://github.com/rubiii/savon/issues/151)
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@ Savon
|
|
3
3
|
|
4
4
|
Heavy metal Ruby SOAP client
|
5
5
|
|
6
|
-
[
|
6
|
+
[Official documentation](http://savonrb.com) | [RDoc](http://rubydoc.info/gems/savon) | [Google Group](http://groups.google.com/group/savon-soap)
|
7
7
|
|
8
8
|
Installation
|
9
9
|
------------
|
@@ -34,4 +34,4 @@ Basic workflow
|
|
34
34
|
Excited to learn more?
|
35
35
|
----------------------
|
36
36
|
|
37
|
-
Then you might want to go ahead and read the
|
37
|
+
Then you might want to [go ahead and read the official documentation](http://savonrb.com).
|
data/lib/savon/client.rb
CHANGED
@@ -118,14 +118,14 @@ module Savon
|
|
118
118
|
# Expects an +input+ and sets the +SOAPAction+ HTTP headers.
|
119
119
|
def set_soap_action(input)
|
120
120
|
soap_action = wsdl.soap_action input.to_sym
|
121
|
-
soap_action ||=
|
121
|
+
soap_action ||= Gyoku::XMLKey.create(input).to_sym
|
122
122
|
http.headers["SOAPAction"] = %{"#{soap_action}"}
|
123
123
|
end
|
124
124
|
|
125
125
|
# Expects a +namespace+, +input+ and +attributes+ and sets the SOAP input.
|
126
126
|
def set_soap_input(namespace, input, attributes)
|
127
127
|
new_input = wsdl.soap_input input.to_sym
|
128
|
-
new_input ||=
|
128
|
+
new_input ||= Gyoku::XMLKey.create(input).to_sym
|
129
129
|
soap.input = [namespace, new_input, attributes].compact
|
130
130
|
end
|
131
131
|
|
data/lib/savon/global.rb
CHANGED
@@ -61,6 +61,22 @@ module Savon
|
|
61
61
|
# Sets whether to strip namespaces in a SOAP response Hash.
|
62
62
|
attr_writer :strip_namespaces
|
63
63
|
|
64
|
+
# Returns the current action_converter
|
65
|
+
attr_reader :converter
|
66
|
+
|
67
|
+
# Sets both action_converter and input_converter, converter should be a proc.
|
68
|
+
def converter=(converter)
|
69
|
+
@converter = converter
|
70
|
+
end
|
71
|
+
|
72
|
+
# Returns the global env_namespace.
|
73
|
+
attr_reader :env_namespace
|
74
|
+
|
75
|
+
# Sets the global env_namespace.
|
76
|
+
def env_namespace=(namespace)
|
77
|
+
@env_namespace = namespace
|
78
|
+
end
|
79
|
+
|
64
80
|
# Reset to default configuration.
|
65
81
|
def reset_config!
|
66
82
|
self.log = true
|
data/lib/savon/soap/xml.rb
CHANGED
@@ -28,7 +28,7 @@ module Savon
|
|
28
28
|
|
29
29
|
# Converts a given SOAP response +xml+ to a Hash.
|
30
30
|
def self.parse(xml)
|
31
|
-
Crack::XML.parse(xml)
|
31
|
+
Crack::XML.parse(xml)
|
32
32
|
end
|
33
33
|
|
34
34
|
# Expects a SOAP response XML or Hash, traverses it for a given +path+ of Hash keys
|
@@ -80,9 +80,9 @@ module Savon
|
|
80
80
|
# Sets the SOAP envelope namespace.
|
81
81
|
attr_writer :env_namespace
|
82
82
|
|
83
|
-
# Returns the SOAP envelope namespace. Defaults to :env.
|
83
|
+
# Returns the SOAP envelope namespace. Uses the global namespace if set Defaults to :env.
|
84
84
|
def env_namespace
|
85
|
-
@env_namespace ||= :env
|
85
|
+
@env_namespace ||= Savon.env_namespace.nil? ? :env : Savon.env_namespace
|
86
86
|
end
|
87
87
|
|
88
88
|
# Sets the +namespaces+ Hash.
|
@@ -181,3 +181,4 @@ module Savon
|
|
181
181
|
end
|
182
182
|
end
|
183
183
|
end
|
184
|
+
|
data/lib/savon/version.rb
CHANGED
data/savon.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.version = Savon::Version
|
9
9
|
s.authors = "Daniel Harrington"
|
10
10
|
s.email = "me@rubiii.com"
|
11
|
-
s.homepage = "http://
|
11
|
+
s.homepage = "http://savonrb.com"
|
12
12
|
s.summary = "Heavy metal Ruby SOAP client"
|
13
13
|
s.description = "Savon is the heavy metal Ruby SOAP client."
|
14
14
|
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.add_dependency "builder", ">= 2.1.2"
|
18
18
|
s.add_dependency "crack", "~> 0.1.8"
|
19
19
|
s.add_dependency "httpi", ">= 0.7.8"
|
20
|
-
s.add_dependency "gyoku", ">= 0.
|
20
|
+
s.add_dependency "gyoku", ">= 0.4.0"
|
21
21
|
|
22
22
|
s.add_development_dependency "rspec", "~> 2.4.0"
|
23
23
|
s.add_development_dependency "autotest"
|
data/spec/savon/soap/xml_spec.rb
CHANGED
@@ -127,6 +127,11 @@ describe Savon::SOAP::XML do
|
|
127
127
|
xml.env_namespace = :soapenv
|
128
128
|
xml.env_namespace.should == :soapenv
|
129
129
|
end
|
130
|
+
|
131
|
+
it "should use the global env_namespace if set as the SOAP envelope namespace" do
|
132
|
+
Savon.stubs(:env_namespace).returns(:soapenv)
|
133
|
+
xml.env_namespace.should == :soapenv
|
134
|
+
end
|
130
135
|
end
|
131
136
|
|
132
137
|
describe "#namespaces" do
|
@@ -223,7 +228,7 @@ describe Savon::SOAP::XML do
|
|
223
228
|
:token => "secret",
|
224
229
|
:attributes! => { :token => { :xmlns => "http://example.com" } }
|
225
230
|
}
|
226
|
-
|
231
|
+
|
227
232
|
xml.to_xml.should include('<env:Header><token xmlns="http://example.com">secret</token></env:Header>')
|
228
233
|
end
|
229
234
|
end
|
@@ -333,3 +338,4 @@ describe Savon::SOAP::XML do
|
|
333
338
|
end
|
334
339
|
|
335
340
|
end
|
341
|
+
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: savon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 59
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 9
|
9
|
+
- 0
|
10
|
+
version: 0.9.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Daniel Harrington
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-04-05 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -74,12 +74,12 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - ">="
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
hash:
|
77
|
+
hash: 15
|
78
78
|
segments:
|
79
79
|
- 0
|
80
|
-
-
|
80
|
+
- 4
|
81
81
|
- 0
|
82
|
-
version: 0.
|
82
|
+
version: 0.4.0
|
83
83
|
type: :runtime
|
84
84
|
version_requirements: *id004
|
85
85
|
- !ruby/object:Gem::Dependency
|
@@ -214,7 +214,7 @@ files:
|
|
214
214
|
- spec/support/endpoint.rb
|
215
215
|
- spec/support/fixture.rb
|
216
216
|
has_rdoc: true
|
217
|
-
homepage: http://
|
217
|
+
homepage: http://savonrb.com
|
218
218
|
licenses: []
|
219
219
|
|
220
220
|
post_install_message:
|