savon 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +77 -50
- data/README.md +1 -1
- data/lib/savon/client.rb +1 -18
- data/lib/savon/log_message.rb +22 -19
- data/lib/savon/version.rb +1 -1
- data/savon.gemspec +8 -7
- data/spec/savon/client_spec.rb +3 -16
- metadata +37 -33
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,30 @@
|
|
1
|
+
## 1.1.0 (2012-06-28)
|
2
|
+
|
3
|
+
* Improvement: Changed Savon's core dependencies to be more strict and only allow bug fix changes.
|
4
|
+
Major or minor releases of these dependencies now need a release of Savon so they can be used.
|
5
|
+
This should improve the stability of the library and make it easier to update, because changes
|
6
|
+
to these core dependencies will be documented here as well.
|
7
|
+
|
8
|
+
* Fix: The latest version of Wasabi should now correctly detect the names of you operations.
|
9
|
+
So you should be able to just get the names of some operation:
|
10
|
+
|
11
|
+
``` ruby
|
12
|
+
client.wsdl.soap_actions
|
13
|
+
# => [:authenticate, :find_user]
|
14
|
+
```
|
15
|
+
|
16
|
+
and pass the Symbol to execute a request:
|
17
|
+
|
18
|
+
``` ruby
|
19
|
+
client.request :authenticate, body: { token: "secret" }
|
20
|
+
```
|
21
|
+
|
22
|
+
If you still pass anything other than a single Symbol to that method, please open an issue!
|
23
|
+
You shouldn't need to specify a namespace or additional attributes for the tag.
|
24
|
+
|
25
|
+
* Refactoring: Moved code that sets the cookies from the last response for the
|
26
|
+
next request to `HTTPI::Request#set_cookies`.
|
27
|
+
|
1
28
|
## 1.0.0 (2012-06-09)
|
2
29
|
|
3
30
|
* Fix: `Savon.client` didn't pass the optional block.
|
@@ -9,15 +36,15 @@
|
|
9
36
|
|
10
37
|
As this change affects `savon_spec`, you need to update `savon_spec` to v1.3.0.
|
11
38
|
|
12
|
-
|
39
|
+
### 0.9.14 (2012-06-07)
|
13
40
|
|
14
41
|
* Fix: [#292](https://github.com/rubiii/savon/issues/292) again
|
15
42
|
|
16
|
-
|
43
|
+
### 0.9.13 (2012-06-07)
|
17
44
|
|
18
45
|
* Fix: [#292](https://github.com/rubiii/savon/issues/292)
|
19
46
|
|
20
|
-
|
47
|
+
### 0.9.12 (2012-06-07)
|
21
48
|
|
22
49
|
* Re-added the log method setters to the new config object for backwards compatibility.
|
23
50
|
You should be able to configure the logger as you used to do.
|
@@ -30,7 +57,7 @@
|
|
30
57
|
end
|
31
58
|
```
|
32
59
|
|
33
|
-
|
60
|
+
### 0.9.11 (2012-06-06)
|
34
61
|
|
35
62
|
* Feature: [#264](https://github.com/rubiii/savon/pull/264) - Thanks to @hoverlover, Savon and Akami now support
|
36
63
|
signed messages through WSSE.
|
@@ -64,7 +91,7 @@
|
|
64
91
|
</env:Envelope>
|
65
92
|
```
|
66
93
|
|
67
|
-
|
94
|
+
### 0.9.10 (2012-06-06)
|
68
95
|
|
69
96
|
* Feature: [#289](https://github.com/rubiii/savon/pull/289) - Allow the SOAP envelope header to be set as a String.
|
70
97
|
|
@@ -94,7 +121,7 @@
|
|
94
121
|
* Moved logging to the new `Savon::Logger` object.
|
95
122
|
* Removed the `blank?` extension from `Object`.
|
96
123
|
|
97
|
-
|
124
|
+
### 0.9.9 (2012-02-17)
|
98
125
|
|
99
126
|
* Improvement: [pull request 255](https://github.com/rubiii/savon/pull/255) - Raise an error if fetching
|
100
127
|
a remote WSDL fails. Possible fix for [issue 236](https://github.com/rubiii/savon/issues/236).
|
@@ -118,7 +145,7 @@
|
|
118
145
|
* Fix: [pull request 265](https://github.com/rubiii/savon/pull/265) - Fixes gemspec problems when bundling
|
119
146
|
under JRuby 1.6.5. Also fixes [issue 267](https://github.com/rubiii/savon/issues/267).
|
120
147
|
|
121
|
-
|
148
|
+
### 0.9.8 (2012-02-15)
|
122
149
|
|
123
150
|
* Feature: Savon now ships with [Savon::Model](http://rubygems.org/gems/savon_model).
|
124
151
|
Savon::Model is a lightweight DSL to be used inside your domain models. It's been refactored
|
@@ -152,7 +179,7 @@
|
|
152
179
|
* Fix: [pull request 250](https://github.com/rubiii/savon/pull/250) - The Content-Length header should
|
153
180
|
be the size in bytes.
|
154
181
|
|
155
|
-
|
182
|
+
### 0.9.7 (2011-08-25)
|
156
183
|
|
157
184
|
* Feature: Merged [pull request 210](https://github.com/rubiii/savon/pull/210) by
|
158
185
|
[mboeh](https://github.com/mboeh) to add `Savon::SOAP::Response#doc` and
|
@@ -181,7 +208,7 @@
|
|
181
208
|
|
182
209
|
* Improvement: [issue 222](https://github.com/rubiii/savon/issues/222) - Set the Content-Length header.
|
183
210
|
|
184
|
-
|
211
|
+
### 0.9.6 (2011-07-07)
|
185
212
|
|
186
213
|
* Improvement/Fix: Updated Savon to use the latest version of [Wasabi](http://rubygems.org/gems/wasabi).
|
187
214
|
This should fix [issue 155](https://github.com/rubiii/savon/issues/155) - Savon can automatically add namespaces
|
@@ -192,16 +219,16 @@
|
|
192
219
|
|
193
220
|
* Fix: [issue 143](https://github.com/rubiii/savon/issues/143) - Updating Wasabi should solve this issue.
|
194
221
|
|
195
|
-
|
222
|
+
### 0.9.5 (2011-07-03)
|
196
223
|
|
197
224
|
* Refactoring: Extracted WSSE authentication out into the [akami](http://rubygems.org/gems/akami) gem.
|
198
225
|
|
199
|
-
|
226
|
+
### 0.9.4 (2011-07-03)
|
200
227
|
|
201
228
|
* Refactoring: Extracted the WSDL parser out into the [wasabi](http://rubygems.org/gems/wasabi) gem.
|
202
229
|
This should isolate upcoming improvements to the parser.
|
203
230
|
|
204
|
-
|
231
|
+
### 0.9.3 (2011-06-30)
|
205
232
|
|
206
233
|
* Fix: [issue 138](https://github.com/rubiii/savon/issues/138) -
|
207
234
|
Savon now supports setting a global SOAP header via `Savon.soap_header=`.
|
@@ -236,7 +263,7 @@
|
|
236
263
|
|
237
264
|
* `Savon::SOAP::Response#basic_hash` is now `Savon::SOAP::Response#hash`.
|
238
265
|
|
239
|
-
|
266
|
+
### 0.9.2 (2011-04-30)
|
240
267
|
|
241
268
|
* Fix: [issue 154](https://github.com/rubiii/savon/pull/154) -
|
242
269
|
Timezone format used by Savon now matches the XML schema spec.
|
@@ -254,7 +281,7 @@
|
|
254
281
|
|
255
282
|
* Improvement: WSDL parsing now uses Nokogiri instead of REXML.
|
256
283
|
|
257
|
-
|
284
|
+
### 0.9.1 (2011-04-06)
|
258
285
|
|
259
286
|
* Improvement: if you're only setting the local or remote address of your wsdl document, you can
|
260
287
|
now pass an (optional) String to `Savon::Client.new` to set `wsdl.document`.
|
@@ -264,13 +291,13 @@
|
|
264
291
|
```
|
265
292
|
|
266
293
|
* Improvement: instead of calling the `to_hash` method of your response again and again and again,
|
267
|
-
there is now a
|
294
|
+
there is now a `#[]` shortcut for you.
|
268
295
|
|
269
296
|
``` ruby
|
270
297
|
response[:authenticate_response][:return]
|
271
298
|
```
|
272
299
|
|
273
|
-
|
300
|
+
### 0.9.0 (2011-04-05)
|
274
301
|
|
275
302
|
* Feature: issues [#158](https://github.com/rubiii/savon/issues/158),
|
276
303
|
[#169](https://github.com/rubiii/savon/issues/169) and [#172](https://github.com/rubiii/savon/issues/172)
|
@@ -322,18 +349,18 @@
|
|
322
349
|
|
323
350
|
* And if you haven't already seen the new documentation: [savonrb.com](http://savonrb.com)
|
324
351
|
|
325
|
-
|
352
|
+
### 0.8.6 (2011-02-15)
|
326
353
|
|
327
354
|
* Fix for issues [issue #147](https://github.com/rubiii/savon/issues/147) and [#151](https://github.com/rubiii/savon/issues/151)
|
328
355
|
([771194](https://github.com/rubiii/savon/commit/771194)).
|
329
356
|
|
330
|
-
|
357
|
+
### 0.8.5 (2011-01-28)
|
331
358
|
|
332
359
|
* Fix for [issue #146](https://github.com/rubiii/savon/issues/146) ([98655c](https://github.com/rubiii/savon/commit/98655c)).
|
333
360
|
|
334
361
|
* Fix for [issue #147](https://github.com/rubiii/savon/issues/147) ([252670](https://github.com/rubiii/savon/commit/252670)).
|
335
362
|
|
336
|
-
|
363
|
+
### 0.8.4 (2011-01-26)
|
337
364
|
|
338
365
|
* Fix for issues [issue #130](https://github.com/rubiii/savon/issues/130) and [#134](https://github.com/rubiii/savon/issues/134)
|
339
366
|
([4f9847](https://github.com/rubiii/savon/commit/4f9847)).
|
@@ -342,14 +369,14 @@
|
|
342
369
|
|
343
370
|
* Fix for [issue #135](https://github.com/rubiii/savon/issues/135) ([c9261d](https://github.com/rubiii/savon/commit/c9261d)).
|
344
371
|
|
345
|
-
|
372
|
+
### 0.8.3 (2011-01-11)
|
346
373
|
|
347
374
|
* Moved implementation of `Savon::SOAP::Response#to_array` to a class method at `Savon::SOAP::XML.to_array`
|
348
375
|
([05a7d3](https://github.com/rubiii/savon/commit/05a7d3)).
|
349
376
|
|
350
377
|
* Fix for [issue #131](https://github.com/rubiii/savon/issues/131) ([4e57b3](https://github.com/rubiii/savon/commit/4e57b3)).
|
351
378
|
|
352
|
-
|
379
|
+
### 0.8.2 (2011-01-04)
|
353
380
|
|
354
381
|
* Fix for [issue #127](https://github.com/rubiii/savon/issues/127) ([0eb3da](https://github.com/rubiii/savon/commit/0eb3da4)).
|
355
382
|
|
@@ -375,7 +402,7 @@
|
|
375
402
|
wsse["wsse:Security"]["wsse:UsernameToken"] = { "Organization" => "ACME", "Domain" => "acme.com" }
|
376
403
|
end
|
377
404
|
|
378
|
-
|
405
|
+
### 0.8.1 (2010-12-22)
|
379
406
|
|
380
407
|
* Update to depend on HTTPI v0.7.5 which comes with a fallback to use Net::HTTP when no other adapter could be required.
|
381
408
|
|
@@ -383,7 +410,7 @@
|
|
383
410
|
|
384
411
|
* Loosen dependency on builder. Should be quite stable.
|
385
412
|
|
386
|
-
|
413
|
+
### 0.8.0 (2010-12-20)
|
387
414
|
|
388
415
|
* Added `Savon::SOAP::XML#env_namespace` ([51fa0e](https://github.com/rubiii/savon/commit/51fa0e)) to configure
|
389
416
|
the SOAP envelope namespace. It defaults to :env but can also be set to an empty String for SOAP envelope
|
@@ -392,7 +419,7 @@
|
|
392
419
|
* Replaced quite a lot of core extensions by moving the Hash to XML translation into a new gem called
|
393
420
|
[Gyoku](http://rubygems.org/gems/gyoku) ([bac4b4](https://github.com/rubiii/savon/commit/bac4b4)).
|
394
421
|
|
395
|
-
|
422
|
+
### 0.8.0.beta.4 (2010-11-20)
|
396
423
|
|
397
424
|
* Fix for [issue #107](https://github.com/rubiii/savon/issues/107) ([1d6eda](https://github.com/rubiii/savon/commit/1d6eda)).
|
398
425
|
|
@@ -406,12 +433,12 @@
|
|
406
433
|
response.to_array :get_user_response, :return
|
407
434
|
# => [{ :id => 1, :name => "foo"}, { :id => 2, :name => "bar"}]
|
408
435
|
|
409
|
-
|
436
|
+
### 0.8.0.beta.3 (2010-11-06)
|
410
437
|
|
411
438
|
* Fix for [savon_spec](http://rubygems.org/gems/savon_spec) to not send nil to `Savon::SOAP::XML#body`
|
412
439
|
([c34b42](https://github.com/rubiii/savon/commit/c34b42)).
|
413
440
|
|
414
|
-
|
441
|
+
### 0.8.0.beta.2 (2010-11-05)
|
415
442
|
|
416
443
|
* Added `Savon.response_pattern` ([0a12fb](https://github.com/rubiii/savon/commit/0a12fb)) to automatically walk deeper into
|
417
444
|
the SOAP response Hash when a pattern (specified as an Array of Regexps and Symbols) matches the response. If for example
|
@@ -446,7 +473,7 @@
|
|
446
473
|
|
447
474
|
* Added `Savon::SOAP::Response#to_array` (which also uses the response pattern).
|
448
475
|
|
449
|
-
|
476
|
+
### 0.8.0.beta.1 (2010-10-29)
|
450
477
|
|
451
478
|
* Changed `Savon::Client.new` to accept a block instead of multiple Hash arguments. You can access the
|
452
479
|
wsdl, http and wsse objects inside the block to configure your client for a particular service.
|
@@ -529,15 +556,15 @@
|
|
529
556
|
|
530
557
|
* Started to remove quite a few core extensions.
|
531
558
|
|
532
|
-
|
559
|
+
### 0.7.9 (2010-06-14)
|
533
560
|
|
534
561
|
* Fix for [issue #53](https://github.com/rubiii/savon/issues/53).
|
535
562
|
|
536
|
-
|
563
|
+
### 0.7.8 (2010-05-09)
|
537
564
|
|
538
565
|
* Fixed gemspec to include missing files in the gem.
|
539
566
|
|
540
|
-
|
567
|
+
### 0.7.7 (2010-05-09)
|
541
568
|
|
542
569
|
* SOAP requests now start with a proper XML declaration.
|
543
570
|
|
@@ -556,7 +583,7 @@
|
|
556
583
|
in SOAP request Hash values, but you can now append an exclamation mark to Hash keys specifying that
|
557
584
|
it's value should not be escaped.
|
558
585
|
|
559
|
-
|
586
|
+
### 0.7.6 (2010-03-21)
|
560
587
|
|
561
588
|
* Moved documentation from the Github Wiki to the actual class files and established a much nicer
|
562
589
|
documentation combining examples and implementation (using Hanna) at: http://savon.rubiii.com
|
@@ -572,7 +599,7 @@
|
|
572
599
|
* Fix for issues [#39](https://github.com/rubiii/savon/issues/39) and [#49](https://github.com/rubiii/savon/issues/49).
|
573
600
|
Added `Savon::SOAP#xml` which let's you specify completely custom SOAP request XML.
|
574
601
|
|
575
|
-
|
602
|
+
### 0.7.5 (2010-02-19)
|
576
603
|
|
577
604
|
* Fix for [issue #34](https://github.com/rubiii/savon/issues/34).
|
578
605
|
|
@@ -582,11 +609,11 @@
|
|
582
609
|
|
583
610
|
* Changed the key for specifying the order of tags from :@inorder to :order!
|
584
611
|
|
585
|
-
|
612
|
+
### 0.7.4 (2010-02-02)
|
586
613
|
|
587
614
|
* Fix for [issue #33](https://github.com/rubiii/savon/issues/33).
|
588
615
|
|
589
|
-
|
616
|
+
### 0.7.3 (2010-01-31)
|
590
617
|
|
591
618
|
* Added support for Geotrust-style WSDL documents (Julian Kornberger <github.corny@digineo.de>).
|
592
619
|
|
@@ -607,7 +634,7 @@
|
|
607
634
|
|
608
635
|
* Fix for [issue #25](https://github.com/rubiii/savon/issues/25).
|
609
636
|
|
610
|
-
|
637
|
+
### 0.7.2 (2010-01-17)
|
611
638
|
|
612
639
|
* Exposed the `Net::HTTP` response (added by Kevin Ingolfsland). Use the `http` accessor (`response.http`)
|
613
640
|
on your `Savon::Response` to access the `Net::HTTP` response object.
|
@@ -620,12 +647,12 @@
|
|
620
647
|
|
621
648
|
* Added support for global header and namespaces. See [issue #9](https://github.com/rubiii/savon/issues/9).
|
622
649
|
|
623
|
-
|
650
|
+
### 0.7.1 (2010-01-10)
|
624
651
|
|
625
652
|
* The Hash of HTTP headers for SOAP calls is now public via `Savon::Request#headers`.
|
626
653
|
Patch for [issue #8](https://github.com/rubiii/savon/issues/8).
|
627
654
|
|
628
|
-
|
655
|
+
### 0.7.0 (2010-01-09)
|
629
656
|
|
630
657
|
This version comes with several changes to the public API!
|
631
658
|
Pay attention to the following list and read the updated Wiki: http://wiki.github.com/rubiii/savon
|
@@ -671,7 +698,7 @@ Pay attention to the following list and read the updated Wiki: http://wiki.githu
|
|
671
698
|
|
672
699
|
soap.namespace = "http://example.com"
|
673
700
|
|
674
|
-
|
701
|
+
### 0.6.8 (2010-01-01)
|
675
702
|
|
676
703
|
* Improved specifications for various kinds of WSDL documents.
|
677
704
|
|
@@ -686,7 +713,7 @@ Pay attention to the following list and read the updated Wiki: http://wiki.githu
|
|
686
713
|
|
687
714
|
client.get_api_key { |soap| soap.input = "User.GetApiKey" }
|
688
715
|
|
689
|
-
|
716
|
+
### 0.6.7 (2009-12-18)
|
690
717
|
|
691
718
|
* Implemented support for a proxy server. The proxy URI can be set through an optional Hash of options passed
|
692
719
|
to instantiating `Savon::Client` (Dave Woodward <dave@futuremint.com>)
|
@@ -696,17 +723,17 @@ Pay attention to the following list and read the updated Wiki: http://wiki.githu
|
|
696
723
|
|
697
724
|
* Patch for [issue #10](https://github.com/rubiii/savon/issues/10).
|
698
725
|
|
699
|
-
|
726
|
+
### 0.6.6 (2009-12-14)
|
700
727
|
|
701
728
|
* Default to use the name of the SOAP action (the method called in a client) in lowerCamelCase for SOAP action
|
702
729
|
and input when Savon::WSDL is disabled. You still need to specify soap.action and maybe soap.input in case
|
703
730
|
your SOAP actions are named any different.
|
704
731
|
|
705
|
-
|
732
|
+
### 0.6.5 (2009-12-13)
|
706
733
|
|
707
734
|
* Added an `open_timeout` method to `Savon::Request`.
|
708
735
|
|
709
|
-
|
736
|
+
### 0.6.4 (2009-12-13)
|
710
737
|
|
711
738
|
* Refactored specs to be less unit-like.
|
712
739
|
|
@@ -722,7 +749,7 @@ Pay attention to the following list and read the updated Wiki: http://wiki.githu
|
|
722
749
|
0.6.4 72.180000 8.280000 80.460000 (750.799011)
|
723
750
|
0.6.3 192.900000 19.630000 212.530000 (914.031865)
|
724
751
|
|
725
|
-
|
752
|
+
### 0.6.3 (2009-12-11)
|
726
753
|
|
727
754
|
* Removing 2 ruby deprecation warnings for parenthesized arguments. (Dave Woodward <dave@futuremint.com>)
|
728
755
|
|
@@ -742,17 +769,17 @@ Pay attention to the following list and read the updated Wiki: http://wiki.githu
|
|
742
769
|
0.6.3 192.900000 19.630000 212.530000 (914.031865)
|
743
770
|
0.6.2 574.720000 78.380000 653.100000 (1387.778539)
|
744
771
|
|
745
|
-
|
772
|
+
### 0.6.2 (2009-12-06)
|
746
773
|
|
747
774
|
* Added support for changing the name of the SOAP input node.
|
748
775
|
|
749
776
|
* Added a CHANGELOG.
|
750
777
|
|
751
|
-
|
778
|
+
### 0.6.1 (2009-12-06)
|
752
779
|
|
753
780
|
* Fixed a problem with WSSE credentials, where every request contained a WSSE authentication header.
|
754
781
|
|
755
|
-
|
782
|
+
### 0.6.0 (2009-12-06)
|
756
783
|
|
757
784
|
* `method_missing` now yields the SOAP and WSSE objects to a given block.
|
758
785
|
|
@@ -760,15 +787,15 @@ Pay attention to the following list and read the updated Wiki: http://wiki.githu
|
|
760
787
|
|
761
788
|
* Improved SOAP action handling (another problem that came up with issue #1).
|
762
789
|
|
763
|
-
|
790
|
+
### 0.5.3 (2009-11-30)
|
764
791
|
|
765
792
|
* Patch for [issue #2](https://github.com/rubiii/savon/issues/2).
|
766
793
|
|
767
|
-
|
794
|
+
### 0.5.2 (2009-11-30)
|
768
795
|
|
769
796
|
* Patch for [issue #1](https://github.com/rubiii/savon/issues/1).
|
770
797
|
|
771
|
-
|
798
|
+
### 0.5.1 (2009-11-29)
|
772
799
|
|
773
800
|
* Optimized default response process.
|
774
801
|
|
@@ -780,6 +807,6 @@ Pay attention to the following list and read the updated Wiki: http://wiki.githu
|
|
780
807
|
|
781
808
|
* Added specs
|
782
809
|
|
783
|
-
|
810
|
+
### 0.5.0 (2009-11-29)
|
784
811
|
|
785
812
|
* Complete rewrite and public release.
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Savon [![Build Status](https://secure.travis-ci.org/rubiii/savon.png?branch=master)](http://travis-ci.org/rubiii/savon)
|
2
2
|
=====
|
3
3
|
|
4
|
-
Heavy metal
|
4
|
+
Heavy metal SOAP client
|
5
5
|
|
6
6
|
[Documentation](http://savonrb.com) | [RDoc](http://rubydoc.info/gems/savon) |
|
7
7
|
[Mailing list](https://groups.google.com/forum/#!forum/savonrb) | [Twitter](http://twitter.com/savonrb)
|
data/lib/savon/client.rb
CHANGED
@@ -82,7 +82,7 @@ module Savon
|
|
82
82
|
soap.wsse = wsse
|
83
83
|
|
84
84
|
response = SOAP::Request.new(config, http, soap).response
|
85
|
-
|
85
|
+
http.set_cookies(response.http)
|
86
86
|
|
87
87
|
if wsse.verify_response
|
88
88
|
WSSE::VerifySignature.new(response.http.body).verify!
|
@@ -99,23 +99,6 @@ module Savon
|
|
99
99
|
# Accessor for the original self of a given block.
|
100
100
|
attr_accessor :original_self
|
101
101
|
|
102
|
-
# Passes a cookie from the last request +headers+ to the next one.
|
103
|
-
def set_cookie(headers)
|
104
|
-
if headers["Set-Cookie"]
|
105
|
-
@cookies ||= {}
|
106
|
-
#handle single or multiple Set-Cookie Headers as returned by Rack::Utils::HeaderHash in HTTPI
|
107
|
-
set_cookies = [headers["Set-Cookie"]].flatten
|
108
|
-
set_cookies.each do |set_cookie|
|
109
|
-
# use the cookie name as the key to the hash to allow for cookie updates and seperation
|
110
|
-
# set the value to name=value (for easy joining), stopping when we hit the Cookie options
|
111
|
-
@cookies[set_cookie.split('=').first] = set_cookie.split(';').first
|
112
|
-
end
|
113
|
-
|
114
|
-
http.headers["Cookie"] = @cookies.values.join(';')
|
115
|
-
end
|
116
|
-
|
117
|
-
end
|
118
|
-
|
119
102
|
# Expects an Array of +args+ and returns an Array containing the namespace (might be +nil+),
|
120
103
|
# the SOAP input and a Hash of attributes for the input tag (which might be empty).
|
121
104
|
def extract_options(args)
|
data/lib/savon/log_message.rb
CHANGED
@@ -1,43 +1,46 @@
|
|
1
1
|
module Savon
|
2
2
|
class LogMessage
|
3
3
|
|
4
|
-
def initialize(message,
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
self.with_filter = options[:filter]
|
9
|
-
end
|
10
|
-
|
11
|
-
attr_accessor :message, :filter, :with_pretty, :with_filter
|
12
|
-
|
13
|
-
def filter?
|
14
|
-
with_filter && filter.any?
|
15
|
-
end
|
16
|
-
|
17
|
-
def pretty?
|
18
|
-
with_pretty
|
4
|
+
def initialize(message, filters, options = {})
|
5
|
+
@message = message
|
6
|
+
@filters = filters
|
7
|
+
@options = options
|
19
8
|
end
|
20
9
|
|
21
10
|
def to_s
|
22
|
-
return message unless pretty? || filter?
|
11
|
+
return @message unless pretty? || filter?
|
23
12
|
|
24
|
-
doc = Nokogiri
|
13
|
+
doc = Nokogiri.XML(@message)
|
25
14
|
doc = apply_filter(doc) if filter?
|
26
15
|
doc.to_xml(pretty_options)
|
27
16
|
end
|
28
17
|
|
29
18
|
private
|
30
19
|
|
20
|
+
def filter?
|
21
|
+
@options[:filter] && @filters.any?
|
22
|
+
end
|
23
|
+
|
24
|
+
def pretty?
|
25
|
+
@options[:pretty]
|
26
|
+
end
|
27
|
+
|
31
28
|
def apply_filter(doc)
|
32
29
|
return doc unless doc.errors.empty?
|
33
30
|
|
34
|
-
|
35
|
-
doc
|
31
|
+
@filters.each do |filter|
|
32
|
+
apply_filter!(doc, filter)
|
36
33
|
end
|
37
34
|
|
38
35
|
doc
|
39
36
|
end
|
40
37
|
|
38
|
+
def apply_filter!(doc, filter)
|
39
|
+
doc.xpath("//*[local-name()='#{filter}']").each do |node|
|
40
|
+
node.content = "***FILTERED***"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
41
44
|
def pretty_options
|
42
45
|
return {} unless pretty?
|
43
46
|
{ :indent => 2 }
|
data/lib/savon/version.rb
CHANGED
data/savon.gemspec
CHANGED
@@ -10,17 +10,18 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.authors = "Daniel Harrington"
|
11
11
|
s.email = "me@rubiii.com"
|
12
12
|
s.homepage = "http://savonrb.com"
|
13
|
-
s.summary = "Heavy metal
|
14
|
-
s.description = "
|
13
|
+
s.summary = "Heavy metal SOAP client"
|
14
|
+
s.description = "Delicious SOAP for the Ruby community"
|
15
15
|
|
16
16
|
s.rubyforge_project = s.name
|
17
17
|
|
18
|
+
s.add_dependency "nori", "~> 1.1.0"
|
19
|
+
s.add_dependency "httpi", "~> 1.1.0"
|
20
|
+
s.add_dependency "wasabi", "~> 2.5.0"
|
21
|
+
s.add_dependency "akami", "~> 1.2.0"
|
22
|
+
s.add_dependency "gyoku", "~> 0.4.5"
|
23
|
+
|
18
24
|
s.add_dependency "builder", ">= 2.1.2"
|
19
|
-
s.add_dependency "nori", "~> 1.1"
|
20
|
-
s.add_dependency "httpi", "~> 1.0"
|
21
|
-
s.add_dependency "wasabi", "~> 2.2"
|
22
|
-
s.add_dependency "akami", "~> 1.1"
|
23
|
-
s.add_dependency "gyoku", ">= 0.4.0"
|
24
25
|
s.add_dependency "nokogiri", ">= 1.4.0"
|
25
26
|
|
26
27
|
s.add_development_dependency "rake", "~> 0.9"
|
data/spec/savon/client_spec.rb
CHANGED
@@ -221,12 +221,8 @@ describe Savon::Client do
|
|
221
221
|
end
|
222
222
|
|
223
223
|
it "should not set the Cookie header for the next request" do
|
224
|
-
client.http.headers.expects(:[]=).with("Cookie", anything).never
|
225
|
-
client.http.headers.stubs(:[]=).with("SOAPAction", '"authenticate"')
|
226
|
-
client.http.headers.stubs(:[]=).with("Content-Type", "text/xml;charset=UTF-8")
|
227
|
-
client.http.headers.stubs(:[]=).with("Content-Length", "383")
|
228
|
-
|
229
224
|
client.request :authenticate
|
225
|
+
client.http.headers["Cookie"].should be_nil
|
230
226
|
end
|
231
227
|
end
|
232
228
|
|
@@ -236,19 +232,10 @@ describe Savon::Client do
|
|
236
232
|
HTTPI.stubs(:post).returns(new_response(:headers => { "Set-Cookie" => "some-cookie=choc-chip; Path=/; HttpOnly" }))
|
237
233
|
end
|
238
234
|
|
239
|
-
it "
|
240
|
-
client.
|
241
|
-
client.http.headers["Cookie"].should == "some-cookie=choc-chip"
|
242
|
-
end
|
243
|
-
|
244
|
-
it "should set additional cookies when new cookies are found in subsequent requests" do
|
235
|
+
it "sets the cookies for the next request" do
|
236
|
+
client.http.expects(:set_cookies).with(kind_of(HTTPI::Response))
|
245
237
|
client.request :authenticate
|
246
|
-
HTTPI.stubs(:post).returns(new_response(:headers => { "Set-Cookie" => "second-cookie=oatmeal; Path=/; HttpOnly" }))
|
247
|
-
client.request :nibble
|
248
|
-
|
249
|
-
client.http.headers["Cookie"].split(";").should include("some-cookie=choc-chip", "second-cookie=oatmeal")
|
250
238
|
end
|
251
|
-
|
252
239
|
end
|
253
240
|
|
254
241
|
context "with a remote WSDL document" do
|
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: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 1.0.0
|
10
|
+
version: 1.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Daniel Harrington
|
@@ -15,21 +15,21 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-06-
|
18
|
+
date: 2012-06-28 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
22
22
|
none: false
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
hash:
|
26
|
+
hash: 19
|
27
27
|
segments:
|
28
|
-
- 2
|
29
28
|
- 1
|
30
|
-
-
|
31
|
-
|
32
|
-
|
29
|
+
- 1
|
30
|
+
- 0
|
31
|
+
version: 1.1.0
|
32
|
+
name: nori
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
35
|
requirement: *id001
|
@@ -39,12 +39,13 @@ dependencies:
|
|
39
39
|
requirements:
|
40
40
|
- - ~>
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
hash:
|
42
|
+
hash: 19
|
43
43
|
segments:
|
44
44
|
- 1
|
45
45
|
- 1
|
46
|
-
|
47
|
-
|
46
|
+
- 0
|
47
|
+
version: 1.1.0
|
48
|
+
name: httpi
|
48
49
|
type: :runtime
|
49
50
|
prerelease: false
|
50
51
|
requirement: *id002
|
@@ -54,12 +55,13 @@ dependencies:
|
|
54
55
|
requirements:
|
55
56
|
- - ~>
|
56
57
|
- !ruby/object:Gem::Version
|
57
|
-
hash:
|
58
|
+
hash: 27
|
58
59
|
segments:
|
59
|
-
-
|
60
|
+
- 2
|
61
|
+
- 5
|
60
62
|
- 0
|
61
|
-
version:
|
62
|
-
name:
|
63
|
+
version: 2.5.0
|
64
|
+
name: wasabi
|
63
65
|
type: :runtime
|
64
66
|
prerelease: false
|
65
67
|
requirement: *id003
|
@@ -69,12 +71,13 @@ dependencies:
|
|
69
71
|
requirements:
|
70
72
|
- - ~>
|
71
73
|
- !ruby/object:Gem::Version
|
72
|
-
hash:
|
74
|
+
hash: 31
|
73
75
|
segments:
|
76
|
+
- 1
|
74
77
|
- 2
|
75
|
-
-
|
76
|
-
version:
|
77
|
-
name:
|
78
|
+
- 0
|
79
|
+
version: 1.2.0
|
80
|
+
name: akami
|
78
81
|
type: :runtime
|
79
82
|
prerelease: false
|
80
83
|
requirement: *id004
|
@@ -84,12 +87,13 @@ dependencies:
|
|
84
87
|
requirements:
|
85
88
|
- - ~>
|
86
89
|
- !ruby/object:Gem::Version
|
87
|
-
hash:
|
90
|
+
hash: 5
|
88
91
|
segments:
|
89
|
-
-
|
90
|
-
-
|
91
|
-
|
92
|
-
|
92
|
+
- 0
|
93
|
+
- 4
|
94
|
+
- 5
|
95
|
+
version: 0.4.5
|
96
|
+
name: gyoku
|
93
97
|
type: :runtime
|
94
98
|
prerelease: false
|
95
99
|
requirement: *id005
|
@@ -101,11 +105,11 @@ dependencies:
|
|
101
105
|
- !ruby/object:Gem::Version
|
102
106
|
hash: 15
|
103
107
|
segments:
|
104
|
-
-
|
105
|
-
-
|
106
|
-
-
|
107
|
-
version:
|
108
|
-
name:
|
108
|
+
- 2
|
109
|
+
- 1
|
110
|
+
- 2
|
111
|
+
version: 2.1.2
|
112
|
+
name: builder
|
109
113
|
type: :runtime
|
110
114
|
prerelease: false
|
111
115
|
requirement: *id006
|
@@ -185,7 +189,7 @@ dependencies:
|
|
185
189
|
type: :development
|
186
190
|
prerelease: false
|
187
191
|
requirement: *id011
|
188
|
-
description:
|
192
|
+
description: Delicious SOAP for the Ruby community
|
189
193
|
email: me@rubiii.com
|
190
194
|
executables: []
|
191
195
|
|
@@ -289,6 +293,6 @@ rubyforge_project: savon
|
|
289
293
|
rubygems_version: 1.8.21
|
290
294
|
signing_key:
|
291
295
|
specification_version: 3
|
292
|
-
summary: Heavy metal
|
296
|
+
summary: Heavy metal SOAP client
|
293
297
|
test_files: []
|
294
298
|
|