savon 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +31 -7
- data/README.textile +0 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/savon.rb +0 -0
- data/lib/savon/client.rb +6 -1
- data/lib/savon/core_ext.rb +0 -0
- data/lib/savon/core_ext/datetime.rb +0 -0
- data/lib/savon/core_ext/hash.rb +0 -0
- data/lib/savon/core_ext/object.rb +0 -0
- data/lib/savon/core_ext/string.rb +0 -0
- data/lib/savon/core_ext/symbol.rb +0 -0
- data/lib/savon/core_ext/uri.rb +0 -0
- data/lib/savon/request.rb +5 -0
- data/lib/savon/response.rb +0 -0
- data/lib/savon/soap.rb +11 -9
- data/lib/savon/wsdl.rb +67 -31
- data/lib/savon/wsse.rb +0 -0
- data/spec/fixtures/multiple_user_response.xml +0 -0
- data/spec/fixtures/soap_fault.xml +0 -0
- data/spec/fixtures/user_fixture.rb +8 -4
- data/spec/fixtures/user_response.xml +0 -0
- data/spec/fixtures/user_wsdl.xml +0 -0
- data/spec/http_stubs.rb +15 -17
- data/spec/savon/client_spec.rb +46 -47
- data/spec/savon/core_ext/datetime_spec.rb +0 -0
- data/spec/savon/core_ext/hash_spec.rb +0 -0
- data/spec/savon/core_ext/object_spec.rb +0 -0
- data/spec/savon/core_ext/string_spec.rb +0 -0
- data/spec/savon/core_ext/symbol_spec.rb +0 -0
- data/spec/savon/core_ext/uri_spec.rb +0 -0
- data/spec/savon/request_spec.rb +44 -64
- data/spec/savon/response_spec.rb +34 -51
- data/spec/savon/savon_spec.rb +13 -19
- data/spec/savon/soap_spec.rb +61 -92
- data/spec/savon/wsdl_spec.rb +19 -34
- data/spec/savon/wsse_spec.rb +42 -58
- data/spec/spec_helper.rb +1 -1
- data/spec/{spec_helper_methods.rb → spec_helper_classes.rb} +32 -4
- metadata +15 -15
data/spec/savon/wsdl_spec.rb
CHANGED
@@ -1,52 +1,37 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe Savon::WSDL do
|
4
|
-
before
|
5
|
-
|
6
|
-
def some_wsdl_instance
|
7
|
-
Savon::WSDL.new Savon::Request.new SpecHelper.some_endpoint
|
4
|
+
before do
|
5
|
+
@wsdl = Savon::WSDL.new Savon::Request.new(EndpointHelper.wsdl_endpoint)
|
8
6
|
end
|
9
7
|
|
10
|
-
|
11
|
-
|
12
|
-
some_wsdl_instance
|
13
|
-
end
|
8
|
+
it "is initialized with a Savon::Request object" do
|
9
|
+
Savon::WSDL.new Savon::Request.new(EndpointHelper.wsdl_endpoint)
|
14
10
|
end
|
15
11
|
|
16
|
-
|
17
|
-
|
18
|
-
@wsdl.namespace_uri.should == UserFixture.namespace_uri
|
19
|
-
end
|
12
|
+
it "has a getter for the namespace URI" do
|
13
|
+
@wsdl.namespace_uri.should == UserFixture.namespace_uri
|
20
14
|
end
|
21
15
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
@wsdl.soap_actions.should == UserFixture.soap_actions
|
16
|
+
it "has a getter for returning an Array of available SOAP actions" do
|
17
|
+
UserFixture.soap_actions.each do |soap_action|
|
18
|
+
@wsdl.soap_actions.should include soap_action
|
26
19
|
end
|
20
|
+
end
|
27
21
|
|
28
|
-
|
29
|
-
|
30
|
-
lambda { wsdl.soap_actions }.should raise_error ArgumentError
|
31
|
-
end
|
22
|
+
it "has a getter for returning a Hash of available SOAP operations" do
|
23
|
+
@wsdl.operations.should == UserFixture.operations
|
32
24
|
end
|
33
25
|
|
34
|
-
|
35
|
-
|
36
|
-
@wsdl.respond_to?(UserFixture.soap_actions.keys.first).
|
37
|
-
should be_true
|
38
|
-
end
|
26
|
+
it "responds to SOAP actions while still behaving as usual otherwise" do
|
27
|
+
@wsdl.respond_to?(UserFixture.soap_actions.first).should be_true
|
39
28
|
|
40
|
-
|
41
|
-
|
42
|
-
@wsdl.respond_to?(:some_undefined_method).should be_false
|
43
|
-
end
|
29
|
+
@wsdl.respond_to?(:object_id).should be_true
|
30
|
+
@wsdl.respond_to?(:some_undefined_method).should be_false
|
44
31
|
end
|
45
32
|
|
46
|
-
|
47
|
-
|
48
|
-
@wsdl.to_s.should == UserFixture.user_wsdl
|
49
|
-
end
|
33
|
+
it "returns the raw WSDL document for to_s" do
|
34
|
+
@wsdl.to_s.should == UserFixture.user_wsdl
|
50
35
|
end
|
51
36
|
|
52
|
-
end
|
37
|
+
end
|
data/spec/savon/wsse_spec.rb
CHANGED
@@ -10,84 +10,68 @@ describe Savon::WSSE do
|
|
10
10
|
@username, @password = "gorilla", "secret"
|
11
11
|
end
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
Savon::WSSE::WSENamespace.should_not be_empty
|
17
|
-
end
|
13
|
+
it "contains the namespace for WS Security Secext" do
|
14
|
+
Savon::WSSE::WSENamespace.should be_a String
|
15
|
+
Savon::WSSE::WSENamespace.should_not be_empty
|
18
16
|
end
|
19
17
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
Savon::WSSE::WSUNamespace.should_not be_empty
|
24
|
-
end
|
18
|
+
it "contains the namespace for WS Security Utility" do
|
19
|
+
Savon::WSSE::WSUNamespace.should be_a String
|
20
|
+
Savon::WSSE::WSUNamespace.should_not be_empty
|
25
21
|
end
|
26
22
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
end
|
23
|
+
it "defaults to nil for the WSSE username (global setting)" do
|
24
|
+
Savon::WSSE.username.should be_nil
|
25
|
+
end
|
31
26
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
end
|
27
|
+
it "has both getter and setter for the WSSE username (global setting)" do
|
28
|
+
Savon::WSSE.username = "gorilla"
|
29
|
+
Savon::WSSE.username.should == "gorilla"
|
36
30
|
end
|
37
31
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
end
|
32
|
+
it "defaults to nil for the WSSE password (global setting)" do
|
33
|
+
Savon::WSSE.password.should be_nil
|
34
|
+
end
|
42
35
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
end
|
36
|
+
it "has both getter and setter for the WSSE password (global setting)" do
|
37
|
+
Savon::WSSE.password = "secret"
|
38
|
+
Savon::WSSE.password.should == "secret"
|
47
39
|
end
|
48
40
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
end
|
41
|
+
it "defaults to nil for whether to use WSSE digest (global setting)" do
|
42
|
+
Savon::WSSE.digest?.should be_false
|
43
|
+
end
|
53
44
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
end
|
45
|
+
it "has both getter and setter for whether to use WSSE digest (global setting)" do
|
46
|
+
Savon::WSSE.digest = true
|
47
|
+
Savon::WSSE.digest?.should == true
|
58
48
|
end
|
59
49
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
end
|
50
|
+
it "defaults to nil for the WSSE username" do
|
51
|
+
@wsse.username.should be_nil
|
52
|
+
end
|
64
53
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
end
|
54
|
+
it "has both getter and setter for the WSSE username" do
|
55
|
+
@wsse.username = "gorilla"
|
56
|
+
@wsse.username.should == "gorilla"
|
69
57
|
end
|
70
58
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
end
|
59
|
+
it "defaults to nil for the WSSE password" do
|
60
|
+
@wsse.password.should be_nil
|
61
|
+
end
|
75
62
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
end
|
63
|
+
it "has both getter and setter for the WSSE password" do
|
64
|
+
@wsse.password = "secret"
|
65
|
+
@wsse.password.should == "secret"
|
80
66
|
end
|
81
67
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
end
|
68
|
+
it "defaults to nil for whether to use WSSE digest" do
|
69
|
+
@wsse.digest?.should be_false
|
70
|
+
end
|
86
71
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
end
|
72
|
+
it "has both getter and setter for whether to use WSSE digest" do
|
73
|
+
@wsse.digest = true
|
74
|
+
@wsse.digest?.should == true
|
91
75
|
end
|
92
76
|
|
93
77
|
describe "header" do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,23 @@
|
|
1
|
-
class
|
1
|
+
class EndpointHelper
|
2
|
+
class << self
|
3
|
+
|
4
|
+
def wsdl_endpoint(type = nil)
|
5
|
+
soap_endpoint(type) << "?wsdl"
|
6
|
+
end
|
2
7
|
|
8
|
+
def soap_endpoint(type = nil)
|
9
|
+
case type
|
10
|
+
when :multiple then "http://multiple.example.com/UserService"
|
11
|
+
when :soap_fault then "http://soapfault.example.com/UserService"
|
12
|
+
when :http_error then "http://httperror.example.com/UserService"
|
13
|
+
when :invalid then "http://invalid.example.com/UserService"
|
14
|
+
else "http://services.example.com/UserService"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
=begin
|
3
21
|
@soap_call_endpoint = "http://services.example.com/UserService"
|
4
22
|
@some_endpoint = @soap_call_endpoint + "?wsdl"
|
5
23
|
@some_endpoint_uri = URI @some_endpoint
|
@@ -15,9 +33,6 @@ class SpecHelper
|
|
15
33
|
|
16
34
|
@soap_invalid_endpoint = "http://invalid.example.com/UserService"
|
17
35
|
@invalid_endpoint = @soap_invalid_endpoint + "?wsdl"
|
18
|
-
|
19
|
-
@wsse_security_nodes = ["wsse:Security", "wsse:UsernameToken",
|
20
|
-
"wsse:Username", "wsse:Password", "wsse:Nonce", "wsu:Created"]
|
21
36
|
|
22
37
|
class << self
|
23
38
|
|
@@ -30,4 +45,17 @@ class SpecHelper
|
|
30
45
|
|
31
46
|
end
|
32
47
|
|
48
|
+
=end
|
49
|
+
|
50
|
+
class SpecHelper
|
51
|
+
=begin
|
52
|
+
@wsse_security_nodes = ["wsse:Security", "wsse:UsernameToken",
|
53
|
+
"wsse:Username", "wsse:Password", "wsse:Nonce", "wsu:Created"]
|
54
|
+
|
55
|
+
class << self
|
56
|
+
|
57
|
+
attr_accessor :wsse_security_nodes
|
58
|
+
|
59
|
+
end
|
60
|
+
=end
|
33
61
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: savon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Harrington
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-12-
|
12
|
+
date: 2009-12-12 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -109,7 +109,7 @@ files:
|
|
109
109
|
- spec/savon/wsdl_spec.rb
|
110
110
|
- spec/savon/wsse_spec.rb
|
111
111
|
- spec/spec_helper.rb
|
112
|
-
- spec/
|
112
|
+
- spec/spec_helper_classes.rb
|
113
113
|
has_rdoc: true
|
114
114
|
homepage: http://github.com/rubiii/savon
|
115
115
|
licenses: []
|
@@ -143,20 +143,20 @@ signing_key:
|
|
143
143
|
specification_version: 3
|
144
144
|
summary: Heavy metal Ruby SOAP client library
|
145
145
|
test_files:
|
146
|
-
- spec/
|
147
|
-
- spec/
|
148
|
-
- spec/savon/savon_spec.rb
|
149
|
-
- spec/savon/wsdl_spec.rb
|
150
|
-
- spec/savon/request_spec.rb
|
146
|
+
- spec/fixtures/user_fixture.rb
|
147
|
+
- spec/http_stubs.rb
|
151
148
|
- spec/savon/client_spec.rb
|
152
|
-
- spec/savon/soap_spec.rb
|
153
|
-
- spec/savon/core_ext/symbol_spec.rb
|
154
|
-
- spec/savon/core_ext/hash_spec.rb
|
155
|
-
- spec/savon/core_ext/string_spec.rb
|
156
149
|
- spec/savon/core_ext/datetime_spec.rb
|
150
|
+
- spec/savon/core_ext/hash_spec.rb
|
157
151
|
- spec/savon/core_ext/object_spec.rb
|
152
|
+
- spec/savon/core_ext/string_spec.rb
|
153
|
+
- spec/savon/core_ext/symbol_spec.rb
|
158
154
|
- spec/savon/core_ext/uri_spec.rb
|
155
|
+
- spec/savon/request_spec.rb
|
156
|
+
- spec/savon/response_spec.rb
|
157
|
+
- spec/savon/savon_spec.rb
|
158
|
+
- spec/savon/soap_spec.rb
|
159
|
+
- spec/savon/wsdl_spec.rb
|
159
160
|
- spec/savon/wsse_spec.rb
|
160
|
-
- spec/
|
161
|
-
- spec/
|
162
|
-
- spec/fixtures/user_fixture.rb
|
161
|
+
- spec/spec_helper.rb
|
162
|
+
- spec/spec_helper_classes.rb
|