johnreitano-savon 0.7.2.1 → 0.7.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +36 -4
- data/README.rdoc +78 -0
- data/Rakefile +15 -9
- data/lib/savon.rb +18 -20
- data/lib/savon/client.rb +60 -32
- data/lib/savon/core_ext.rb +8 -3
- data/lib/savon/core_ext/array.rb +31 -0
- data/lib/savon/core_ext/datetime.rb +1 -1
- data/lib/savon/core_ext/hash.rb +74 -50
- data/lib/savon/core_ext/net_http.rb +1 -2
- data/lib/savon/core_ext/object.rb +1 -3
- data/lib/savon/core_ext/string.rb +23 -4
- data/lib/savon/core_ext/uri.rb +3 -3
- data/lib/savon/logger.rb +56 -0
- data/lib/savon/request.rb +61 -60
- data/lib/savon/response.rb +68 -12
- data/lib/savon/soap.rb +180 -54
- data/lib/savon/wsdl.rb +77 -62
- data/lib/savon/wsdl_stream.rb +85 -0
- data/lib/savon/wsse.rb +45 -18
- data/spec/basic_spec_helper.rb +0 -1
- data/spec/endpoint_helper.rb +1 -0
- data/spec/fixtures/wsdl/xml/geotrust.xml +156 -0
- data/spec/http_stubs.rb +3 -0
- data/spec/savon/client_spec.rb +6 -2
- data/spec/savon/core_ext/array_spec.rb +19 -0
- data/spec/savon/core_ext/datetime_spec.rb +1 -1
- data/spec/savon/core_ext/hash_spec.rb +104 -64
- data/spec/savon/core_ext/object_spec.rb +1 -1
- data/spec/savon/core_ext/string_spec.rb +21 -2
- data/spec/savon/core_ext/uri_spec.rb +4 -0
- data/spec/savon/request_spec.rb +12 -8
- data/spec/savon/soap_spec.rb +141 -111
- data/spec/savon/wsdl_spec.rb +18 -0
- metadata +39 -19
- data/README.textile +0 -75
- data/spec/savon/savon_spec.rb +0 -23
data/spec/savon/wsdl_spec.rb
CHANGED
@@ -76,6 +76,24 @@ describe Savon::WSDL do
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
+
describe "a WSDL document from geotrust" do
|
80
|
+
before { @wsdl = new_wsdl :geotrust }
|
81
|
+
|
82
|
+
it "returns the namespace URI" do
|
83
|
+
@wsdl.namespace_uri.should == WSDLFixture.geotrust(:namespace_uri)
|
84
|
+
end
|
85
|
+
|
86
|
+
it "returns an Array of available SOAP actions" do
|
87
|
+
WSDLFixture.geotrust(:operations).keys.each do |soap_action|
|
88
|
+
@wsdl.soap_actions.should include(soap_action)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
it "returns a Hash of SOAP operations" do
|
93
|
+
@wsdl.operations.should == WSDLFixture.geotrust(:operations)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
79
97
|
def new_wsdl(fixture = nil)
|
80
98
|
endpoint = fixture ? EndpointHelper.wsdl_endpoint(fixture) : EndpointHelper.wsdl_endpoint
|
81
99
|
Savon::WSDL.new Savon::Request.new(endpoint)
|
metadata
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: johnreitano-savon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 105
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
9
|
+
- 7
|
10
10
|
- 1
|
11
|
-
version: 0.7.
|
11
|
+
version: 0.7.7.1
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
|
-
-
|
14
|
+
- Daniel Harrington
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-
|
19
|
+
date: 2010-03-29 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -52,9 +52,25 @@ dependencies:
|
|
52
52
|
type: :runtime
|
53
53
|
version_requirements: *id002
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
|
-
name:
|
55
|
+
name: ntlm-http
|
56
56
|
prerelease: false
|
57
57
|
requirement: &id003 !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
hash: 25
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
- 1
|
66
|
+
- 1
|
67
|
+
version: 0.1.1
|
68
|
+
type: :runtime
|
69
|
+
version_requirements: *id003
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rspec
|
72
|
+
prerelease: false
|
73
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
58
74
|
none: false
|
59
75
|
requirements:
|
60
76
|
- - ">="
|
@@ -66,11 +82,11 @@ dependencies:
|
|
66
82
|
- 8
|
67
83
|
version: 1.2.8
|
68
84
|
type: :development
|
69
|
-
version_requirements: *
|
85
|
+
version_requirements: *id004
|
70
86
|
- !ruby/object:Gem::Dependency
|
71
87
|
name: mocha
|
72
88
|
prerelease: false
|
73
|
-
requirement: &
|
89
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
74
90
|
none: false
|
75
91
|
requirements:
|
76
92
|
- - ">="
|
@@ -82,11 +98,11 @@ dependencies:
|
|
82
98
|
- 7
|
83
99
|
version: 0.9.7
|
84
100
|
type: :development
|
85
|
-
version_requirements: *
|
101
|
+
version_requirements: *id005
|
86
102
|
- !ruby/object:Gem::Dependency
|
87
103
|
name: fakeweb
|
88
104
|
prerelease: false
|
89
|
-
requirement: &
|
105
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
90
106
|
none: false
|
91
107
|
requirements:
|
92
108
|
- - ">="
|
@@ -98,20 +114,21 @@ dependencies:
|
|
98
114
|
- 7
|
99
115
|
version: 1.2.7
|
100
116
|
type: :development
|
101
|
-
version_requirements: *
|
117
|
+
version_requirements: *id006
|
102
118
|
description:
|
103
|
-
email: me@
|
119
|
+
email: me@rubiii.com
|
104
120
|
executables: []
|
105
121
|
|
106
122
|
extensions: []
|
107
123
|
|
108
124
|
extra_rdoc_files:
|
109
|
-
- README.
|
125
|
+
- README.rdoc
|
110
126
|
files:
|
111
127
|
- CHANGELOG
|
112
128
|
- Rakefile
|
113
|
-
- README.
|
129
|
+
- README.rdoc
|
114
130
|
- lib/savon/client.rb
|
131
|
+
- lib/savon/core_ext/array.rb
|
115
132
|
- lib/savon/core_ext/datetime.rb
|
116
133
|
- lib/savon/core_ext/hash.rb
|
117
134
|
- lib/savon/core_ext/net_http.rb
|
@@ -120,10 +137,12 @@ files:
|
|
120
137
|
- lib/savon/core_ext/symbol.rb
|
121
138
|
- lib/savon/core_ext/uri.rb
|
122
139
|
- lib/savon/core_ext.rb
|
140
|
+
- lib/savon/logger.rb
|
123
141
|
- lib/savon/request.rb
|
124
142
|
- lib/savon/response.rb
|
125
143
|
- lib/savon/soap.rb
|
126
144
|
- lib/savon/wsdl.rb
|
145
|
+
- lib/savon/wsdl_stream.rb
|
127
146
|
- lib/savon/wsse.rb
|
128
147
|
- lib/savon.rb
|
129
148
|
- spec/basic_spec_helper.rb
|
@@ -134,6 +153,7 @@ files:
|
|
134
153
|
- spec/integration/http_basic_auth_spec.rb
|
135
154
|
- spec/integration/server.rb
|
136
155
|
- spec/savon/client_spec.rb
|
156
|
+
- spec/savon/core_ext/array_spec.rb
|
137
157
|
- spec/savon/core_ext/datetime_spec.rb
|
138
158
|
- spec/savon/core_ext/hash_spec.rb
|
139
159
|
- spec/savon/core_ext/net_http_spec.rb
|
@@ -143,7 +163,6 @@ files:
|
|
143
163
|
- spec/savon/core_ext/uri_spec.rb
|
144
164
|
- spec/savon/request_spec.rb
|
145
165
|
- spec/savon/response_spec.rb
|
146
|
-
- spec/savon/savon_spec.rb
|
147
166
|
- spec/savon/soap_spec.rb
|
148
167
|
- spec/savon/wsdl_spec.rb
|
149
168
|
- spec/savon/wsse_spec.rb
|
@@ -153,19 +172,20 @@ files:
|
|
153
172
|
- spec/fixtures/response/xml/soap_fault.xml
|
154
173
|
- spec/fixtures/response/xml/soap_fault12.xml
|
155
174
|
- spec/fixtures/wsdl/xml/authentication.xml
|
175
|
+
- spec/fixtures/wsdl/xml/geotrust.xml
|
156
176
|
- spec/fixtures/wsdl/xml/namespaced_actions.xml
|
157
177
|
- spec/fixtures/wsdl/xml/no_namespace.xml
|
158
178
|
has_rdoc: true
|
159
|
-
homepage: http://github.com/
|
179
|
+
homepage: http://github.com/rubiii/savon
|
160
180
|
licenses: []
|
161
181
|
|
162
182
|
post_install_message:
|
163
183
|
rdoc_options:
|
164
184
|
- --charset=UTF-8
|
165
|
-
- --title
|
166
|
-
- Savon
|
167
185
|
- --line-numbers
|
168
186
|
- --inline-source
|
187
|
+
- --title
|
188
|
+
- Savon - Heavy metal Ruby SOAP client library
|
169
189
|
require_paths:
|
170
190
|
- lib
|
171
191
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -202,6 +222,7 @@ test_files:
|
|
202
222
|
- spec/integration/http_basic_auth_spec.rb
|
203
223
|
- spec/integration/server.rb
|
204
224
|
- spec/savon/client_spec.rb
|
225
|
+
- spec/savon/core_ext/array_spec.rb
|
205
226
|
- spec/savon/core_ext/datetime_spec.rb
|
206
227
|
- spec/savon/core_ext/hash_spec.rb
|
207
228
|
- spec/savon/core_ext/net_http_spec.rb
|
@@ -211,7 +232,6 @@ test_files:
|
|
211
232
|
- spec/savon/core_ext/uri_spec.rb
|
212
233
|
- spec/savon/request_spec.rb
|
213
234
|
- spec/savon/response_spec.rb
|
214
|
-
- spec/savon/savon_spec.rb
|
215
235
|
- spec/savon/soap_spec.rb
|
216
236
|
- spec/savon/wsdl_spec.rb
|
217
237
|
- spec/savon/wsse_spec.rb
|
data/README.textile
DELETED
@@ -1,75 +0,0 @@
|
|
1
|
-
h1. Savon
|
2
|
-
|
3
|
-
h4. Heavy metal Ruby SOAP client library
|
4
|
-
|
5
|
-
p. "RDoc":http://rdoc.info/projects/rubiii/savon | "Wiki":http://wiki.github.com/rubiii/savon | "ToDo":http://rubiii.tadalist.com/lists/1459816/public | "Metrics":http://getcaliper.com/caliper/project?repo=git://github.com/rubiii/savon.git
|
6
|
-
|
7
|
-
h2. Warning
|
8
|
-
|
9
|
-
p. Savon 0.7.0 comes with several changes to the public API. Pay attention to the CHANGELOG and the updated Wiki.
|
10
|
-
|
11
|
-
h2. Installation
|
12
|
-
|
13
|
-
bc. $ gem install savon
|
14
|
-
|
15
|
-
p. Savon expects you to be familiar with SOAP, WSDL and tools like soapUI.
|
16
|
-
|
17
|
-
h2. Instantiate a client
|
18
|
-
|
19
|
-
p. Instantiate Savon::Client, passing in the WSDL of your service.
|
20
|
-
|
21
|
-
bc. client = Savon::Client.new "http://example.com/UserService?wsdl"
|
22
|
-
|
23
|
-
p. More information: "Client":http://wiki.github.com/rubiii/savon/client
|
24
|
-
|
25
|
-
h2. Calling a SOAP action
|
26
|
-
|
27
|
-
p. Assuming your service applies to the defaults, you can now call any available SOAP action.
|
28
|
-
|
29
|
-
bc. response = client.get_all_users
|
30
|
-
|
31
|
-
p. Savon lets you call SOAP actions using snake_case, because even though they will propably be written in lowerCamelCase or CamelCase, it just feels much more natural.
|
32
|
-
|
33
|
-
h2. The WSDL object
|
34
|
-
|
35
|
-
p. Savon::WSDL represents the WSDL of your service, including information like the namespace URI and available SOAP actions.
|
36
|
-
|
37
|
-
bc. client.wsdl.soap_actions
|
38
|
-
=> [:get_all_users, :get_user_by_id, :user_magic]
|
39
|
-
|
40
|
-
p. More information: "WSDL":http://wiki.github.com/rubiii/savon/wsdl
|
41
|
-
|
42
|
-
h2. The SOAP object
|
43
|
-
|
44
|
-
p. Savon::SOAP represents the SOAP request. Pass a block to your SOAP call and the SOAP object is passed to it as the first argument. The object allows setting the SOAP version, header, body and namespaces per request.
|
45
|
-
|
46
|
-
bc. response = client.get_user_by_id { |soap| soap.body = { :id => 666 } }
|
47
|
-
|
48
|
-
p. More information: "SOAP":http://wiki.github.com/rubiii/savon/soap
|
49
|
-
|
50
|
-
h2. The WSSE object
|
51
|
-
|
52
|
-
p. Savon::WSSE represents WSSE authentication. Pass a block to your SOAP call and the WSSE object is passed to it as the second argument. The object allows setting the WSSE username, password and whether to use digest authentication.
|
53
|
-
|
54
|
-
bc. response = client.get_user_by_id do |soap, wsse|
|
55
|
-
wsse.username = "gorilla"
|
56
|
-
wsse.password = "secret"
|
57
|
-
soap.body = { :id => 666 }
|
58
|
-
end
|
59
|
-
|
60
|
-
p. More information: "WSSE":http://wiki.github.com/rubiii/savon/wsse
|
61
|
-
|
62
|
-
h2. The Response object
|
63
|
-
|
64
|
-
p. Savon::Response represents the HTTP and SOAP response. It contains and raises errors in case of an HTTP error or SOAP fault (unless disabled). Also you can get the response as XML (for parsing it with an XML library) or translated into a Hash.
|
65
|
-
More information: "Response":http://wiki.github.com/rubiii/savon/response
|
66
|
-
|
67
|
-
h2. HTTP errors and SOAP faults
|
68
|
-
|
69
|
-
p. Savon raises a Savon::SOAPFault in case of a SOAP fault and a Savon::HTTPError in case of an HTTP error.
|
70
|
-
More information: "Errors":http://wiki.github.com/rubiii/savon/errors
|
71
|
-
|
72
|
-
h2. Logging
|
73
|
-
|
74
|
-
p. Savon logs each request and response to STDOUT. But there are a couple of options to change the default behavior.
|
75
|
-
More information: "Logging":http://wiki.github.com/rubiii/savon/logging
|
data/spec/savon/savon_spec.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Savon do
|
4
|
-
|
5
|
-
it "contains an Array of supported SOAP versions" do
|
6
|
-
Savon::SOAPVersions.should be_an(Array)
|
7
|
-
Savon::SOAPVersions.should_not be_empty
|
8
|
-
end
|
9
|
-
|
10
|
-
it "contains the xs:dateTime format" do
|
11
|
-
Savon::SOAPDateTimeFormat.should be_a(String)
|
12
|
-
Savon::SOAPDateTimeFormat.should_not be_empty
|
13
|
-
|
14
|
-
DateTime.new(2012, 03, 22, 16, 22, 33).strftime(Savon::SOAPDateTimeFormat).
|
15
|
-
should == "2012-03-22T16:22:33"
|
16
|
-
end
|
17
|
-
|
18
|
-
it "contains a Regexp matching the xs:dateTime format" do
|
19
|
-
Savon::SOAPDateTimeRegexp.should be_a(Regexp)
|
20
|
-
(Savon::SOAPDateTimeRegexp === "2012-03-22T16:22:33").should be_true
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|