savon 0.8.0.beta.4 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +95 -80
- data/lib/savon/core_ext/hash.rb +0 -87
- data/lib/savon/core_ext/object.rb +0 -10
- data/lib/savon/core_ext/string.rb +0 -17
- data/lib/savon/soap/xml.rb +28 -8
- data/lib/savon/version.rb +1 -1
- data/savon.gemspec +3 -1
- data/spec/fixtures/response/{xml/another_soap_fault.xml → another_soap_fault.xml} +0 -0
- data/spec/fixtures/response/{xml/authentication.xml → authentication.xml} +0 -0
- data/spec/fixtures/response/{xml/list.xml → list.xml} +0 -0
- data/spec/fixtures/response/{xml/multi_ref.xml → multi_ref.xml} +0 -0
- data/spec/fixtures/response/{xml/soap_fault.xml → soap_fault.xml} +0 -0
- data/spec/fixtures/response/{xml/soap_fault12.xml → soap_fault12.xml} +0 -0
- data/spec/fixtures/wsdl/{xml/authentication.xml → authentication.xml} +0 -0
- data/spec/fixtures/wsdl/{xml/geotrust.xml → geotrust.xml} +0 -0
- data/spec/fixtures/wsdl/{xml/namespaced_actions.xml → namespaced_actions.xml} +0 -0
- data/spec/fixtures/wsdl/{xml/no_namespace.xml → no_namespace.xml} +0 -0
- data/spec/savon/client_spec.rb +8 -8
- data/spec/savon/core_ext/hash_spec.rb +0 -126
- data/spec/savon/core_ext/object_spec.rb +0 -15
- data/spec/savon/core_ext/string_spec.rb +0 -22
- data/spec/savon/http/error_spec.rb +1 -1
- data/spec/savon/soap/fault_spec.rb +4 -4
- data/spec/savon/soap/request_spec.rb +1 -1
- data/spec/savon/soap/response_spec.rb +6 -5
- data/spec/savon/soap/xml_spec.rb +33 -5
- data/spec/savon/wsdl/document_spec.rb +3 -3
- data/spec/savon/wsdl/parser_spec.rb +1 -1
- data/spec/savon/wsdl/request_spec.rb +1 -1
- data/spec/spec_helper.rb +3 -9
- data/spec/support/fixture.rb +37 -0
- metadata +56 -39
- data/lib/savon/core_ext/array.rb +0 -45
- data/lib/savon/core_ext/datetime.rb +0 -19
- data/lib/savon/core_ext/symbol.rb +0 -16
- data/spec/fixtures/gzip/gzip_response_fixture.rb +0 -7
- data/spec/fixtures/response/response_fixture.rb +0 -40
- data/spec/fixtures/wsdl/wsdl_fixture.rb +0 -43
- data/spec/fixtures/wsdl/wsdl_fixture.yml +0 -42
- data/spec/savon/core_ext/array_spec.rb +0 -49
- data/spec/savon/core_ext/datetime_spec.rb +0 -21
- data/spec/savon/core_ext/symbol_spec.rb +0 -12
data/CHANGELOG.md
CHANGED
@@ -1,25 +1,35 @@
|
|
1
|
+
## 0.8.0.beta.5 (UPCOMING)
|
2
|
+
|
3
|
+
* Added `Savon::SOAP::XML#env_namespace` ([bac4b4](https://github.com/rubiii/savon/commit/bac4b4)) to configure
|
4
|
+
the SOAP envelope namespace. It defaults to :env but can also be set to an empty String for SOAP envelope
|
5
|
+
tags without a namespace.
|
6
|
+
|
7
|
+
* Replaced quite a lot of core extensions by moving the Hash to XML translation into a new gem called
|
8
|
+
[Gyoku](http://rubygems.org/gems/gyoku) ([51fa0e](https://github.com/rubiii/savon/commit/51fa0e)).
|
9
|
+
|
1
10
|
## 0.8.0.beta.4 (2010-11-20)
|
2
11
|
|
3
|
-
* Fix for issue #107 (
|
12
|
+
* Fix for [issue #107](https://github.com/rubiii/savon/issues/107) ([1d6eda](https://github.com/rubiii/savon/commit/1d6eda)).
|
4
13
|
|
5
|
-
* Fix for issue #108
|
14
|
+
* Fix for [issue #108](https://github.com/rubiii/savon/issues/108)
|
15
|
+
([f64400...0aaca2](https://github.com/rubiii/savon/compare/f64400...0aaca2)) Thanks [fagiani](https://github.com/fagiani).
|
6
16
|
|
7
|
-
* Replaced Savon.response_pattern with a slightly different implementation of the
|
8
|
-
|
9
|
-
|
10
|
-
or an empty Array in case the key is nil or does not exist.
|
17
|
+
* Replaced `Savon.response_pattern` with a slightly different implementation of the `Savon::SOAP::Response#to_array` method
|
18
|
+
([6df6a6](https://github.com/rubiii/savon/commit/6df6a6)). The method now accepts multiple arguments representing the response
|
19
|
+
Hash keys to traverse and returns the result as an Array or an empty Array in case the key is nil or does not exist.
|
11
20
|
|
12
21
|
response.to_array :get_user_response, :return
|
13
22
|
# => [{ :id => 1, :name => "foo"}, { :id => 2, :name => "bar"}]
|
14
23
|
|
15
24
|
## 0.8.0.beta.3 (2010-11-06)
|
16
25
|
|
17
|
-
* Fix for [savon_spec](http://rubygems.org/gems/savon_spec) to not send nil to Savon::SOAP::XML#body
|
26
|
+
* Fix for [savon_spec](http://rubygems.org/gems/savon_spec) to not send nil to `Savon::SOAP::XML#body`
|
27
|
+
([c34b42](https://github.com/rubiii/savon/commit/c34b42)).
|
18
28
|
|
19
29
|
## 0.8.0.beta.2 (2010-11-05)
|
20
30
|
|
21
|
-
* Added Savon.response_pattern to automatically walk deeper into
|
22
|
-
pattern (specified as an Array of Regexps and Symbols) matches the response. If for example
|
31
|
+
* Added `Savon.response_pattern` ([0a12fb](https://github.com/rubiii/savon/commit/0a12fb)) to automatically walk deeper into
|
32
|
+
the SOAP response Hash when a pattern (specified as an Array of Regexps and Symbols) matches the response. If for example
|
23
33
|
your response always looks like ".+Response/return" as in:
|
24
34
|
|
25
35
|
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
|
@@ -49,11 +59,11 @@
|
|
49
59
|
Please notice, that if you don't specify a response pattern or if the pattern doesn't match the
|
50
60
|
response, Savon will behave like it always did.
|
51
61
|
|
52
|
-
* Added Savon::SOAP::Response#to_array (which also uses the response pattern).
|
62
|
+
* Added `Savon::SOAP::Response#to_array` (which also uses the response pattern).
|
53
63
|
|
54
64
|
## 0.8.0.beta.1 (2010-10-29)
|
55
65
|
|
56
|
-
* Changed Savon::Client.new to accept a block instead of multiple Hash arguments. You can access the
|
66
|
+
* Changed `Savon::Client.new` to accept a block instead of multiple Hash arguments. You can access the
|
57
67
|
wsdl, http and wsse objects inside the block to configure your client for a particular service.
|
58
68
|
|
59
69
|
# Instantiating a client to work with a WSDL document
|
@@ -67,15 +77,15 @@
|
|
67
77
|
wsdl.namespace = "http://v1.example.com"
|
68
78
|
end
|
69
79
|
|
70
|
-
* Fix for issue #77
|
71
|
-
|
80
|
+
* Fix for [issue #77](https://github.com/rubiii/savon/issues/77), which means you can now use
|
81
|
+
local WSDL documents:
|
72
82
|
|
73
83
|
client = Savon::Client.new do
|
74
84
|
wsdl.document = "../wsdl/service.xml"
|
75
85
|
end
|
76
86
|
|
77
87
|
* Changed the way SOAP requests are being dispatched. Instead of using method_missing, you now use
|
78
|
-
the new
|
88
|
+
the new `request` method, which also accepts a block for you to access the wsdl, http, wsse and
|
79
89
|
soap object. Please notice, that a new soap object is created for every request. So you can only
|
80
90
|
access it inside this block.
|
81
91
|
|
@@ -84,49 +94,51 @@
|
|
84
94
|
soap.body = { :id => 1 }
|
85
95
|
end
|
86
96
|
|
87
|
-
* The new Savon::Client#request method fixes issues #37,
|
88
|
-
|
97
|
+
* The new `Savon::Client#request` method fixes issues [#37](https://github.com/rubiii/savon/issues/37),
|
98
|
+
[#61](https://github.com/rubiii/savon/issues/61) and [#64](https://github.com/rubiii/savon/issues/64),
|
99
|
+
which report problems with namespacing the SOAP input tag and attaching attributes to it.
|
100
|
+
Some usage examples:
|
89
101
|
|
90
102
|
client.request :get_user # Input tag: <getUser>
|
91
103
|
client.request :wsdl, "GetUser" # Input tag: <wsdl:GetUser>
|
92
104
|
client.request :get_user :active => true # Input tag: <getUser active="true">
|
93
105
|
|
94
|
-
* Savon's new
|
106
|
+
* Savon's new `request` method respects the given namespace. If you don't give it a namespace,
|
95
107
|
Savon will set the target namespace to "xmlns:wsdl". But if you do specify a namespace, it will
|
96
108
|
be set to the given Symbol.
|
97
109
|
|
98
|
-
* Refactored Savon to use the new HTTPI
|
99
|
-
HTTPI::Request replaces the Savon::Request
|
110
|
+
* Refactored Savon to use the new [HTTPI](http://rubygems.org/gems/httpi) gem.
|
111
|
+
`HTTPI::Request` replaces the `Savon::Request`, so please make sure to have a look
|
100
112
|
at the HTTPI library and let me know about any problems. Using HTTPI actually
|
101
113
|
fixes the following two issues.
|
102
114
|
|
103
115
|
* Savon now adds both "xmlns:xsd" and "xmlns:xsi" namespaces for you. Thanks Averell.
|
104
116
|
It also properly serializes nil values as xsi:nil = "true".
|
105
117
|
|
106
|
-
* Fix for issue #24
|
118
|
+
* Fix for [issue #24](https://github.com/rubiii/savon/issues/24).
|
107
119
|
Instead of Net/HTTP, Savon now uses HTTPI to execute HTTP requests.
|
108
120
|
HTTPI defaults to use HTTPClient which supports HTTP digest authentication.
|
109
121
|
|
110
|
-
* Fix for issue #76
|
122
|
+
* Fix for [issue #76](https://github.com/rubiii/savon/issues/76).
|
111
123
|
You now have to explicitly specify whether to use a WSDL document, when instantiating a client.
|
112
124
|
|
113
|
-
* Fix for issue #75
|
114
|
-
Both Savon::SOAP::Fault and Savon::HTTP::Error now contain the HTTPI::Response
|
115
|
-
They also inherit from Savon::Error
|
125
|
+
* Fix for [issue #75](https://github.com/rubiii/savon/issues/75).
|
126
|
+
Both `Savon::SOAP::Fault` and `Savon::HTTP::Error` now contain the `HTTPI::Response`.
|
127
|
+
They also inherit from `Savon::Error`, making it easier to rescue both at the same time.
|
116
128
|
|
117
|
-
* Fix for issue #87
|
129
|
+
* Fix for [issue #87](https://github.com/rubiii/savon/issues/87).
|
118
130
|
Thanks to Leonardo Borges.
|
119
131
|
|
120
|
-
* Fix for issue #81
|
121
|
-
Replaced Savon::WSDL::Document#to_s with a
|
132
|
+
* Fix for [issue #81](https://github.com/rubiii/savon/issues/81).
|
133
|
+
Replaced `Savon::WSDL::Document#to_s` with a `to_xml` method.
|
122
134
|
|
123
|
-
* Fix for issues #85 and #88
|
135
|
+
* Fix for issues [#85](https://github.com/rubiii/savon/issues/85) and [#88](https://github.com/rubiii/savon/issues/88).
|
124
136
|
|
125
|
-
* Fix for issue #80
|
137
|
+
* Fix for [issue #80](https://github.com/rubiii/savon/issues/80).
|
126
138
|
|
127
|
-
* Fix for issue #60
|
139
|
+
* Fix for [issue #60](https://github.com/rubiii/savon/issues/60).
|
128
140
|
|
129
|
-
* Fix for issue 96
|
141
|
+
* Fix for [issue #96](https://github.com/rubiii/savon/issues/96).
|
130
142
|
|
131
143
|
* Removed global WSSE credentials. Authentication needs to be set up for each client instance.
|
132
144
|
|
@@ -134,7 +146,7 @@
|
|
134
146
|
|
135
147
|
## 0.7.9 (2010-06-14)
|
136
148
|
|
137
|
-
* Fix for issue #53
|
149
|
+
* Fix for [issue #53](https://github.com/rubiii/savon/issues/53).
|
138
150
|
|
139
151
|
## 0.7.8 (2010-05-09)
|
140
152
|
|
@@ -149,43 +161,45 @@
|
|
149
161
|
|
150
162
|
client = Savon::Client.new "http://example.com/UserService?wsdl", :gzip => true
|
151
163
|
|
152
|
-
* Fix for issue #51. Added the :soap_endpoint option to
|
153
|
-
specify a SOAP endpoint per client instance:
|
164
|
+
* Fix for [issue #51](https://github.com/rubiii/savon/issues/51). Added the :soap_endpoint option to
|
165
|
+
`Savon::Client.new` which lets you specify a SOAP endpoint per client instance:
|
154
166
|
|
155
167
|
client = Savon::Client.new "http://example.com/UserService?wsdl",
|
156
168
|
:soap_endpoint => "http://localhost/UserService"
|
157
169
|
|
158
|
-
* Fix for issue #50. Savon still escapes special characters
|
159
|
-
append an exclamation mark to Hash keys specifying that
|
170
|
+
* Fix for [issue #50](https://github.com/rubiii/savon/issues/50). Savon still escapes special characters
|
171
|
+
in SOAP request Hash values, but you can now append an exclamation mark to Hash keys specifying that
|
172
|
+
it's value should not be escaped.
|
160
173
|
|
161
174
|
## 0.7.6 (2010-03-21)
|
162
175
|
|
163
176
|
* Moved documentation from the Github Wiki to the actual class files and established a much nicer
|
164
177
|
documentation combining examples and implementation (using Hanna) at: http://savon.rubiii.com
|
165
178
|
|
166
|
-
* Added
|
167
|
-
existing methods. Fix for issue #48.
|
179
|
+
* Added `Savon::Client#call` as a workaround for dispatching calls to SOAP actions named after
|
180
|
+
existing methods. Fix for [issue #48](https://github.com/rubiii/savon/issues/48).
|
168
181
|
|
169
|
-
* Add support for specifying attributes for duplicate tags (via Hash values as Arrays).
|
182
|
+
* Add support for specifying attributes for duplicate tags (via Hash values as Arrays).
|
183
|
+
Fix for [issue #45](https://github.com/rubiii/savon/issues/45).
|
170
184
|
|
171
|
-
* Fix for issue #41
|
185
|
+
* Fix for [issue #41](https://github.com/rubiii/savon/issues/41).
|
172
186
|
|
173
|
-
* Fix for
|
174
|
-
SOAP request XML.
|
187
|
+
* Fix for issues [#39](https://github.com/rubiii/savon/issues/39) and [#49](https://github.com/rubiii/savon/issues/49).
|
188
|
+
Added `Savon::SOAP#xml` which let's you specify completely custom SOAP request XML.
|
175
189
|
|
176
190
|
## 0.7.5 (2010-02-19)
|
177
191
|
|
178
|
-
* Fix for issue #34
|
192
|
+
* Fix for [issue #34](https://github.com/rubiii/savon/issues/34).
|
179
193
|
|
180
|
-
* Fix for issue #36
|
194
|
+
* Fix for [issue #36](https://github.com/rubiii/savon/issues/36).
|
181
195
|
|
182
|
-
* Added feature requested in issue #35
|
196
|
+
* Added feature requested in [issue #35](https://github.com/rubiii/savon/issues/35).
|
183
197
|
|
184
198
|
* Changed the key for specifying the order of tags from :@inorder to :order!
|
185
199
|
|
186
200
|
## 0.7.4 (2010-02-02)
|
187
201
|
|
188
|
-
* Fix for issue #33
|
202
|
+
* Fix for [issue #33](https://github.com/rubiii/savon/issues/33).
|
189
203
|
|
190
204
|
## 0.7.3 (2010-01-31)
|
191
205
|
|
@@ -196,49 +210,50 @@
|
|
196
210
|
|
197
211
|
* Avoid warning on 1.8.7 and 1.9.1 (Adrian Mugnolo <adrian@mugnolo.com>).
|
198
212
|
|
199
|
-
* Fix for issue #29
|
213
|
+
* Fix for [issue #29](https://github.com/rubiii/savon/issues/29).
|
214
|
+
Default to UTC to xs:dateTime value for WSSE authentication.
|
200
215
|
|
201
|
-
* Fix for issue #28
|
216
|
+
* Fix for [issue #28](https://github.com/rubiii/savon/issues/28).
|
202
217
|
|
203
|
-
* Fix for issue #27
|
218
|
+
* Fix for [issue #27](https://github.com/rubiii/savon/issues/27). The Content-Type now defaults to UTF-8.
|
204
219
|
|
205
220
|
* Modification to allow assignment of an Array with an input name and an optional Hash of values to soap.input.
|
206
|
-
Patches issue #30 (stanleydrew <andrewmbenton@gmail.com>).
|
221
|
+
Patches [issue #30](https://github.com/rubiii/savon/issues/30) (stanleydrew <andrewmbenton@gmail.com>).
|
207
222
|
|
208
|
-
* Fix for issue #25
|
223
|
+
* Fix for [issue #25](https://github.com/rubiii/savon/issues/25).
|
209
224
|
|
210
225
|
## 0.7.2 (2010-01-17)
|
211
226
|
|
212
|
-
* Exposed the Net::HTTP response (added by Kevin Ingolfsland). Use the
|
213
|
-
Savon::Response to access the
|
227
|
+
* Exposed the `Net::HTTP` response (added by Kevin Ingolfsland). Use the `http` accessor (`response.http`)
|
228
|
+
on your `Savon::Response` to access the `Net::HTTP` response object.
|
214
229
|
|
215
|
-
* Fix for issue #21
|
230
|
+
* Fix for [issue #21](https://github.com/rubiii/savon/issues/21).
|
216
231
|
|
217
|
-
* Fix for issue #22
|
232
|
+
* Fix for [issue #22](https://github.com/rubiii/savon/issues/22).
|
218
233
|
|
219
|
-
* Fix for issue #19
|
234
|
+
* Fix for [issue #19](https://github.com/rubiii/savon/issues/19).
|
220
235
|
|
221
|
-
* Added support for global header and namespaces. See issue #9
|
236
|
+
* Added support for global header and namespaces. See [issue #9](https://github.com/rubiii/savon/issues/9).
|
222
237
|
|
223
238
|
## 0.7.1 (2010-01-10)
|
224
239
|
|
225
|
-
* The Hash of HTTP headers for SOAP calls is now public via
|
226
|
-
Patch for
|
240
|
+
* The Hash of HTTP headers for SOAP calls is now public via `Savon::Request#headers`.
|
241
|
+
Patch for [issue #8](https://github.com/rubiii/savon/issues/8).
|
227
242
|
|
228
243
|
## 0.7.0 (2010-01-09)
|
229
244
|
|
230
245
|
This version comes with several changes to the public API!
|
231
246
|
Pay attention to the following list and read the updated Wiki: http://wiki.github.com/rubiii/savon
|
232
247
|
|
233
|
-
* Changed how Savon::WSDL can be disabled. Instead of disabling the WSDL globally/per request via two
|
234
|
-
different methods, you now simply append an exclamation mark (!) to your SOAP call: client.get_all_users
|
248
|
+
* Changed how `Savon::WSDL` can be disabled. Instead of disabling the WSDL globally/per request via two
|
249
|
+
different methods, you now simply append an exclamation mark (!) to your SOAP call: `client.get_all_users!`
|
235
250
|
Make sure you know what you're doing because when the WSDL is disabled, Savon does not know about which
|
236
251
|
SOAP actions are valid and just dispatches everything.
|
237
252
|
|
238
|
-
* The Net::HTTP object used by Savon::Request to retrieve WSDL documents and execute SOAP calls is now public.
|
253
|
+
* The `Net::HTTP` object used by `Savon::Request` to retrieve WSDL documents and execute SOAP calls is now public.
|
239
254
|
While this makes the library even more flexible, it also comes with two major changes:
|
240
255
|
|
241
|
-
* SSL client authentication needs to be defined directly on the
|
256
|
+
* SSL client authentication needs to be defined directly on the `Net::HTTP` object:
|
242
257
|
|
243
258
|
client.request.http.client_cert = ...
|
244
259
|
|
@@ -246,12 +261,12 @@ Pay attention to the following list and read the updated Wiki: http://wiki.githu
|
|
246
261
|
|
247
262
|
client.request.http.ssl_client_auth :client_cert => ...
|
248
263
|
|
249
|
-
* Open and read timeouts also need to be set on the
|
264
|
+
* Open and read timeouts also need to be set on the `Net::HTTP` object:
|
250
265
|
|
251
266
|
client.request.http.open_timeout = 30
|
252
267
|
client.request.http.read_timeout = 30
|
253
268
|
|
254
|
-
* Please refer to the
|
269
|
+
* Please refer to the `Net::HTTP` documentation for more details:
|
255
270
|
http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/index.html
|
256
271
|
|
257
272
|
* Thanks to JulianMorrison, Savon now supports HTTP basic authentication:
|
@@ -263,11 +278,11 @@ Pay attention to the following list and read the updated Wiki: http://wiki.githu
|
|
263
278
|
|
264
279
|
client.find_user { |soap| soap.body = { :name => "Lucy", :id => 666, :@inorder => [:id, :name] } }
|
265
280
|
|
266
|
-
*
|
281
|
+
* `Savon::Response#to_hash` now returns the content inside of "soap:Body" instead of trying to go one
|
267
282
|
level deeper and return it's content. The previous implementation only worked when the "soap:Body" element
|
268
|
-
contained a single child. See
|
283
|
+
contained a single child. See [issue #17](https://github.com/rubiii/savon/issues/17).
|
269
284
|
|
270
|
-
* Added
|
285
|
+
* Added `Savon::SOAP#namespace` as a shortcut for setting the "xmlns:wsdl" namespace.
|
271
286
|
|
272
287
|
soap.namespace = "http://example.com"
|
273
288
|
|
@@ -279,7 +294,7 @@ Pay attention to the following list and read the updated Wiki: http://wiki.githu
|
|
279
294
|
|
280
295
|
* Changed how SOAP actions and inputs are retrieved from the WSDL documents. This might break a few existing
|
281
296
|
implementations, but makes Savon work well with even more services. If this change breaks your implementation,
|
282
|
-
please take a look at the
|
297
|
+
please take a look at the `action` and `input` methods of the `Savon::SOAP` object.
|
283
298
|
One specific problem I know of is working with the createsend WSDL and its namespaced actions.
|
284
299
|
|
285
300
|
To make it work, call the SOAP action without namespace and specify the input manually:
|
@@ -289,12 +304,12 @@ Pay attention to the following list and read the updated Wiki: http://wiki.githu
|
|
289
304
|
## 0.6.7 (2009-12-18)
|
290
305
|
|
291
306
|
* Implemented support for a proxy server. The proxy URI can be set through an optional Hash of options passed
|
292
|
-
to instantiating
|
307
|
+
to instantiating `Savon::Client` (Dave Woodward <dave@futuremint.com>)
|
293
308
|
|
294
309
|
* Implemented support for SSL client authentication. Settings can be set through an optional Hash of arguments
|
295
|
-
passed to instantiating
|
310
|
+
passed to instantiating `Savon::Client` (colonhyphenp)
|
296
311
|
|
297
|
-
* Patch for issue #10
|
312
|
+
* Patch for [issue #10](https://github.com/rubiii/savon/issues/10).
|
298
313
|
|
299
314
|
## 0.6.6 (2009-12-14)
|
300
315
|
|
@@ -304,15 +319,15 @@ Pay attention to the following list and read the updated Wiki: http://wiki.githu
|
|
304
319
|
|
305
320
|
## 0.6.5 (2009-12-13)
|
306
321
|
|
307
|
-
* Added an
|
322
|
+
* Added an `open_timeout` method to `Savon::Request`.
|
308
323
|
|
309
324
|
## 0.6.4 (2009-12-13)
|
310
325
|
|
311
326
|
* Refactored specs to be less unit-like.
|
312
327
|
|
313
|
-
* Added a getter for the
|
328
|
+
* Added a getter for the `Savon::Request` to `Savon::Client` and a `read_timeout` setter for HTTP requests.
|
314
329
|
|
315
|
-
* wsdl.soap_actions now returns an Array of SOAP actions. For the previous "mapping" please use
|
330
|
+
* `wsdl.soap_actions` now returns an Array of SOAP actions. For the previous "mapping" please use `wsdl.operations`.
|
316
331
|
|
317
332
|
* Replaced WSDL document with stream parsing.
|
318
333
|
|
@@ -326,7 +341,7 @@ Pay attention to the following list and read the updated Wiki: http://wiki.githu
|
|
326
341
|
|
327
342
|
* Removing 2 ruby deprecation warnings for parenthesized arguments. (Dave Woodward <dave@futuremint.com>)
|
328
343
|
|
329
|
-
* Added global and per request options for disabling
|
344
|
+
* Added global and per request options for disabling `Savon::WSDL`.
|
330
345
|
|
331
346
|
Benchmarks (1000 SOAP calls):
|
332
347
|
|
@@ -354,19 +369,19 @@ Pay attention to the following list and read the updated Wiki: http://wiki.githu
|
|
354
369
|
|
355
370
|
## 0.6.0 (2009-12-06)
|
356
371
|
|
357
|
-
* method_missing now yields the SOAP and WSSE objects to a given block.
|
372
|
+
* `method_missing` now yields the SOAP and WSSE objects to a given block.
|
358
373
|
|
359
|
-
* The response_process (which previously was a block passed to method_missing) was replaced by
|
374
|
+
* The response_process (which previously was a block passed to method_missing) was replaced by `Savon::Response`.
|
360
375
|
|
361
376
|
* Improved SOAP action handling (another problem that came up with issue #1).
|
362
377
|
|
363
378
|
## 0.5.3 (2009-11-30)
|
364
379
|
|
365
|
-
* Patch for issue #2
|
380
|
+
* Patch for [issue #2](https://github.com/rubiii/savon/issues/2).
|
366
381
|
|
367
382
|
## 0.5.2 (2009-11-30)
|
368
383
|
|
369
|
-
* Patch for issue #1
|
384
|
+
* Patch for [issue #1](https://github.com/rubiii/savon/issues/1).
|
370
385
|
|
371
386
|
## 0.5.1 (2009-11-29)
|
372
387
|
|
data/lib/savon/core_ext/hash.rb
CHANGED
@@ -3,9 +3,6 @@ require "builder"
|
|
3
3
|
require "savon"
|
4
4
|
require "savon/core_ext/object"
|
5
5
|
require "savon/core_ext/string"
|
6
|
-
require "savon/core_ext/symbol"
|
7
|
-
require "savon/core_ext/array"
|
8
|
-
require "savon/core_ext/datetime"
|
9
6
|
|
10
7
|
module Savon
|
11
8
|
module CoreExt
|
@@ -19,74 +16,6 @@ module Savon
|
|
19
16
|
body_key ? envelope[body_key].map_soap_response : {}
|
20
17
|
end
|
21
18
|
|
22
|
-
# Translates the Hash into SOAP request compatible XML.
|
23
|
-
#
|
24
|
-
# { :find_user => { :id => 123, "wsdl:Key" => "api" } }.to_soap_xml
|
25
|
-
# # => "<findUser><id>123</id><wsdl:Key>api</wsdl:Key></findUser>"
|
26
|
-
#
|
27
|
-
# ==== Mapping
|
28
|
-
#
|
29
|
-
# * Hash keys specified as Symbols are converted to lowerCamelCase Strings
|
30
|
-
# * Hash keys specified as Strings are not converted and may contain namespaces
|
31
|
-
# * DateTime values are converted to xs:dateTime Strings
|
32
|
-
# * Objects responding to to_datetime (except Strings) are converted to xs:dateTime Strings
|
33
|
-
# * TrueClass and FalseClass objects are converted to "true" and "false" Strings
|
34
|
-
# * All other objects are expected to be converted to Strings using to_s
|
35
|
-
#
|
36
|
-
# An example:
|
37
|
-
#
|
38
|
-
# { :magic_request => {
|
39
|
-
# :perform_move => true,
|
40
|
-
# "perform_at" => DateTime.new(2010, 11, 22, 11, 22, 33)
|
41
|
-
# }
|
42
|
-
# }.to_soap_xml
|
43
|
-
#
|
44
|
-
# <magicRequest>
|
45
|
-
# <performMove>true</performMove>
|
46
|
-
# <perform_at>2012-06-11T10:42:21</perform_at>
|
47
|
-
# </magicRequest>
|
48
|
-
#
|
49
|
-
# ==== Escaped XML values
|
50
|
-
#
|
51
|
-
# By default, special characters in XML String values are escaped.
|
52
|
-
#
|
53
|
-
# ==== Fixed order of XML tags
|
54
|
-
#
|
55
|
-
# In case your service requires the tags to be in a specific order (parameterOrder), you have two
|
56
|
-
# options. The first is to specify your body as an XML string. The second is to specify the order
|
57
|
-
# through an additional array stored under the +:order!+ key.
|
58
|
-
#
|
59
|
-
# { :name => "Eve", :id => 123, :order! => [:id, :name] }.to_soap_xml
|
60
|
-
# # => "<id>123</id><name>Eve</name>"
|
61
|
-
#
|
62
|
-
# ==== XML attributes
|
63
|
-
#
|
64
|
-
# If you need attributes, you could either go with an XML string or add another hash under the
|
65
|
-
# +:attributes!+ key.
|
66
|
-
#
|
67
|
-
# { :person => "Eve", :attributes! => { :person => { :id => 666 } } }.to_soap_xml
|
68
|
-
# # => '<person id="666">Eve</person>'
|
69
|
-
def to_soap_xml
|
70
|
-
xml = Builder::XmlMarkup.new
|
71
|
-
attributes = delete(:attributes!) || {}
|
72
|
-
|
73
|
-
order.each do |key|
|
74
|
-
attrs = attributes[key] || {}
|
75
|
-
value = self[key]
|
76
|
-
escape_xml = key.to_s[-1, 1] != "!"
|
77
|
-
key = key.to_soap_key
|
78
|
-
|
79
|
-
case value
|
80
|
-
when ::Array then xml << value.to_soap_xml(key, escape_xml, attrs)
|
81
|
-
when ::Hash then xml.tag!(key, attrs) { xml << value.to_soap_xml }
|
82
|
-
when NilClass then xml.tag!(key, "xsi:nil" => "true")
|
83
|
-
else xml.tag!(key, attrs) { xml << (escape_xml ? value.to_soap_value : value.to_soap_value!) }
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
xml.target!
|
88
|
-
end
|
89
|
-
|
90
19
|
# Maps keys and values of a Hash created from SOAP response XML to more convenient Ruby Objects.
|
91
20
|
def map_soap_response
|
92
21
|
inject({}) do |hash, (key, value)|
|
@@ -112,22 +41,6 @@ module Savon
|
|
112
41
|
end
|
113
42
|
end
|
114
43
|
|
115
|
-
private
|
116
|
-
|
117
|
-
# Deletes and returns an Array of keys stored under the :order! key. Defaults to return the actual
|
118
|
-
# keys of this Hash if no :order! key could be found. Raises an ArgumentError in case the :order!
|
119
|
-
# Array does not match the Hash keys.
|
120
|
-
def order
|
121
|
-
order = delete :order!
|
122
|
-
order = keys unless order.kind_of? ::Array
|
123
|
-
|
124
|
-
missing, spurious = keys - order, order - keys
|
125
|
-
raise ArgumentError, "Missing elements in :order! #{missing.inspect}" unless missing.empty?
|
126
|
-
raise ArgumentError, "Spurious elements in :order! #{spurious.inspect}" unless spurious.empty?
|
127
|
-
|
128
|
-
order
|
129
|
-
end
|
130
|
-
|
131
44
|
end
|
132
45
|
end
|
133
46
|
end
|