savon 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +11 -3
- data/lib/savon/client.rb +8 -1
- data/lib/savon/version.rb +1 -1
- data/savon.gemspec +3 -3
- data/spec/savon/client_spec.rb +23 -0
- metadata +11 -11
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,19 @@
|
|
1
|
-
## 0.8.
|
1
|
+
## 0.8.1
|
2
2
|
|
3
|
-
*
|
3
|
+
* Update to depend on HTTPI v0.7.5 which comes with a fallback to use Net::HTTP when no other adapter could be required.
|
4
|
+
|
5
|
+
* Fix for [issue #72](https://github.com/rubiii/savon/issues/72) ([22074a8](https://github.com/rubiii/savon/commit/22074a8)).
|
6
|
+
|
7
|
+
* Loosen dependency on builder. Should be quite stable.
|
8
|
+
|
9
|
+
## 0.8.0 (2010-12-20)
|
10
|
+
|
11
|
+
* Added `Savon::SOAP::XML#env_namespace` ([51fa0e](https://github.com/rubiii/savon/commit/51fa0e)) to configure
|
4
12
|
the SOAP envelope namespace. It defaults to :env but can also be set to an empty String for SOAP envelope
|
5
13
|
tags without a namespace.
|
6
14
|
|
7
15
|
* 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) ([
|
16
|
+
[Gyoku](http://rubygems.org/gems/gyoku) ([bac4b4](https://github.com/rubiii/savon/commit/bac4b4)).
|
9
17
|
|
10
18
|
## 0.8.0.beta.4 (2010-11-20)
|
11
19
|
|
data/lib/savon/client.rb
CHANGED
@@ -75,7 +75,9 @@ module Savon
|
|
75
75
|
process &block if block
|
76
76
|
soap.wsse = wsse
|
77
77
|
|
78
|
-
SOAP::Request.new(http, soap).response
|
78
|
+
response = SOAP::Request.new(http, soap).response
|
79
|
+
set_cookie response.http.headers
|
80
|
+
response
|
79
81
|
end
|
80
82
|
|
81
83
|
private
|
@@ -86,6 +88,11 @@ module Savon
|
|
86
88
|
# Accessor for the original self of a given block.
|
87
89
|
attr_accessor :original_self
|
88
90
|
|
91
|
+
# Passes a cookie from the last request +headers+ to the next one.
|
92
|
+
def set_cookie(headers)
|
93
|
+
http.headers["Cookie"] = headers["Set-Cookie"] if headers["Set-Cookie"]
|
94
|
+
end
|
95
|
+
|
89
96
|
# Expects an Array of +args+ and returns an Array containing the namespace (might be +nil+),
|
90
97
|
# the SOAP input and a Hash of attributes for the input tag (which might be empty).
|
91
98
|
def extract_options(args)
|
data/lib/savon/version.rb
CHANGED
data/savon.gemspec
CHANGED
@@ -14,10 +14,10 @@ Gem::Specification.new do |s|
|
|
14
14
|
|
15
15
|
s.rubyforge_project = s.name
|
16
16
|
|
17
|
-
s.add_dependency "builder", "
|
17
|
+
s.add_dependency "builder", ">= 2.1.2"
|
18
18
|
s.add_dependency "crack", "~> 0.1.8"
|
19
|
-
s.add_dependency "httpi", ">= 0.7.
|
20
|
-
s.add_dependency "gyoku", ">= 0.1.
|
19
|
+
s.add_dependency "httpi", ">= 0.7.5"
|
20
|
+
s.add_dependency "gyoku", ">= 0.1.1"
|
21
21
|
|
22
22
|
s.add_development_dependency "rspec", "~> 2.0.0"
|
23
23
|
s.add_development_dependency "autotest"
|
data/spec/savon/client_spec.rb
CHANGED
@@ -185,6 +185,29 @@ describe Savon::Client do
|
|
185
185
|
client.request(:authenticate) { wsdl.should be_a(Savon::WSDL::Document) }
|
186
186
|
end
|
187
187
|
end
|
188
|
+
|
189
|
+
it "should not set the Cookie header for the next request" do
|
190
|
+
client.http.headers.expects(:[]=).with("Cookie", anything).never
|
191
|
+
client.http.headers.stubs(:[]=).with("SOAPAction", '"authenticate"')
|
192
|
+
client.http.headers.stubs(:[]=).with("Content-Type", "text/xml;charset=UTF-8")
|
193
|
+
|
194
|
+
client.request :authenticate
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
context "#request with a Set-Cookie response header" do
|
199
|
+
before do
|
200
|
+
HTTPI.stubs(:get).returns(new_response(:body => Fixture.wsdl(:authentication)))
|
201
|
+
HTTPI.stubs(:post).returns(new_response(:headers => { "Set-Cookie" => "some-cookie" }))
|
202
|
+
end
|
203
|
+
|
204
|
+
it "should set the Cookie header for the next request" do
|
205
|
+
client.http.headers.expects(:[]=).with("Cookie", "some-cookie")
|
206
|
+
client.http.headers.stubs(:[]=).with("SOAPAction", '"authenticate"')
|
207
|
+
client.http.headers.stubs(:[]=).with("Content-Type", "text/xml;charset=UTF-8")
|
208
|
+
|
209
|
+
client.request :authenticate
|
210
|
+
end
|
188
211
|
end
|
189
212
|
|
190
213
|
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: 61
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 0.8.
|
9
|
+
- 1
|
10
|
+
version: 0.8.1
|
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: 2010-12-
|
18
|
+
date: 2010-12-22 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
hash: 15
|
30
30
|
segments:
|
@@ -58,12 +58,12 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
hash:
|
61
|
+
hash: 9
|
62
62
|
segments:
|
63
63
|
- 0
|
64
64
|
- 7
|
65
|
-
-
|
66
|
-
version: 0.7.
|
65
|
+
- 5
|
66
|
+
version: 0.7.5
|
67
67
|
type: :runtime
|
68
68
|
version_requirements: *id003
|
69
69
|
- !ruby/object:Gem::Dependency
|
@@ -74,12 +74,12 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - ">="
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
hash:
|
77
|
+
hash: 25
|
78
78
|
segments:
|
79
79
|
- 0
|
80
80
|
- 1
|
81
|
-
-
|
82
|
-
version: 0.1.
|
81
|
+
- 1
|
82
|
+
version: 0.1.1
|
83
83
|
type: :runtime
|
84
84
|
version_requirements: *id004
|
85
85
|
- !ruby/object:Gem::Dependency
|