savon 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +33 -0
- data/README.textile +31 -38
- data/VERSION +1 -1
- data/lib/savon/soap.rb +3 -0
- data/spec/savon/soap_spec.rb +7 -1
- metadata +2 -1
data/CHANGELOG
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
== 0.6.2 (2009-12-06)
|
2
|
+
* 1 minor improvement
|
3
|
+
* Support for changing the name of the SOAP input node.
|
4
|
+
* Added a CHANGELOG.
|
5
|
+
|
6
|
+
== 0.6.1 (2009-12-06)
|
7
|
+
* 1 minor patch
|
8
|
+
* Fixed a problem with WSSE credentials, where every request contained a WSSE authentication header.
|
9
|
+
|
10
|
+
== 0.6.0 (2009-12-06)
|
11
|
+
* 3 major improvements
|
12
|
+
* method_missing now yields the SOAP and WSSE objects to a given block.
|
13
|
+
* The response_process (which previously was a block passed to method_missing) was replaced by the Savon::Response object.
|
14
|
+
* Improved SOAP action handling (another problem that came up with Issue #1).
|
15
|
+
|
16
|
+
== 0.5.3 (2009-11-30)
|
17
|
+
* 1 minor patch
|
18
|
+
* Fix for Issue #2 (NoMethodError: undefined method `invalid!' for Savon::WSDL)
|
19
|
+
|
20
|
+
== 0.5.2 (2009-11-30)
|
21
|
+
* 1 minor patch
|
22
|
+
* Patch for Issue #1 (Calls fail if api methods have periods in them)
|
23
|
+
|
24
|
+
== 0.5.1 (2009-11-29)
|
25
|
+
* 3 improvements
|
26
|
+
* Optimized default response process.
|
27
|
+
* Added WSSE settings via defaults.
|
28
|
+
* Added SOAP fault and HTTP error handling.
|
29
|
+
* Documentation
|
30
|
+
* Specs
|
31
|
+
|
32
|
+
== 0.5.0 (2009-11-29)
|
33
|
+
* Complete rewrite.
|
data/README.textile
CHANGED
@@ -1,52 +1,45 @@
|
|
1
|
-
|
1
|
+
h1. Savon
|
2
2
|
|
3
|
-
|
3
|
+
h4. Heavy metal Ruby SOAP client library
|
4
4
|
|
5
5
|
bc. $ gem install savon
|
6
6
|
|
7
|
-
|
7
|
+
p. Savon expects you to be familiar with SOAP, WSDL and tools like soapUI.
|
8
8
|
|
9
|
-
|
10
|
-
crack >= 0.1.4
|
11
|
-
|
12
|
-
h2. Warning
|
13
|
-
|
14
|
-
p. To use this heavy metal library, you should be familiar with SOAP, WSDL and tools like soapUI.
|
15
|
-
|
16
|
-
h2. Instantiate Savon::Client
|
9
|
+
h3. Instantiate a client
|
17
10
|
|
18
11
|
p. Instantiate Savon::Client, passing in the WSDL of your service.
|
19
12
|
|
20
13
|
bc. client = Savon::Client.new "http://example.com/UserService?wsdl"
|
21
14
|
|
22
|
-
|
15
|
+
h3. Calling a SOAP action
|
23
16
|
|
24
|
-
p.
|
17
|
+
p. Assuming your service applies to the "Defaults":http://wiki.github.com/rubiii/savon/defaults, you can now call any available SOAP action.
|
25
18
|
|
26
|
-
bc. client.
|
27
|
-
=> [:get_all_users, :get_user_by_id, :user_magic]
|
19
|
+
bc. response = client.get_all_users
|
28
20
|
|
29
|
-
p.
|
21
|
+
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.
|
30
22
|
|
31
|
-
|
23
|
+
h3. The WSDL object
|
32
24
|
|
33
|
-
p.
|
25
|
+
p. Savon::WSDL represents the WSDL of your service, including information like the namespace URI and available SOAP actions.
|
34
26
|
|
35
|
-
bc.
|
27
|
+
bc. client.wsdl.soap_actions.keys
|
28
|
+
=> [:get_all_users, :get_user_by_id, :user_magic]
|
36
29
|
|
37
|
-
p.
|
30
|
+
p. More information: "WSDL":http://wiki.github.com/rubiii/savon/wsdl
|
38
31
|
|
39
|
-
|
32
|
+
h3. The SOAP object
|
40
33
|
|
41
|
-
p. Pass a block to the SOAP
|
34
|
+
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.
|
42
35
|
|
43
36
|
bc. response = client.get_user_by_id { |soap| soap.body = { :id => 666 } }
|
44
37
|
|
45
|
-
p.
|
38
|
+
p. More information: "SOAP":http://wiki.github.com/rubiii/savon/soap
|
46
39
|
|
47
|
-
|
40
|
+
h3. The WSSE object
|
48
41
|
|
49
|
-
p. Pass a block to
|
42
|
+
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.
|
50
43
|
|
51
44
|
bc. response = client.get_user_by_id do |soap, wsse|
|
52
45
|
wsse.username = "gorilla"
|
@@ -54,24 +47,24 @@ bc. response = client.get_user_by_id do |soap, wsse|
|
|
54
47
|
soap.body = { :id => 666 }
|
55
48
|
end
|
56
49
|
|
57
|
-
p.
|
58
|
-
|
59
|
-
h2. The response
|
60
|
-
|
61
|
-
p. The response is wrapped in an object to give you various options of handling it. Take a look at the "Response":http://wiki.github.com/rubiii/savon/response for more information.
|
50
|
+
p. More information: "WSSE":http://wiki.github.com/rubiii/savon/wsse
|
62
51
|
|
63
|
-
|
52
|
+
h3. The Response object
|
64
53
|
|
65
|
-
p. Savon
|
54
|
+
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.
|
55
|
+
More information: "Response":http://wiki.github.com/rubiii/savon/response
|
66
56
|
|
67
|
-
|
57
|
+
h3. HTTP errors and SOAP faults
|
68
58
|
|
69
|
-
p.
|
59
|
+
p. Savon raises a Savon::SOAPFault in case of a SOAP fault and a Savon::HTTPError in case of an HTTP error.
|
60
|
+
More information: "Errors":http://wiki.github.com/rubiii/savon/errors
|
70
61
|
|
71
|
-
|
62
|
+
h3. Logging
|
72
63
|
|
73
|
-
|
64
|
+
p. Savon logs each request and response to STDOUT. But there are a couple of options to change the default behaviour.
|
65
|
+
More information: "Logging":http://wiki.github.com/rubiii/savon/logging
|
74
66
|
|
75
|
-
|
67
|
+
h3. Documentation
|
76
68
|
|
77
|
-
p.
|
69
|
+
p. Wiki: "wiki.github.com/rubiii/savon":http://wiki.github.com/rubiii/savon
|
70
|
+
RDoc: "rdoc.info/projects/rubiii/savon":http://rdoc.info/projects/rubiii/savon
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.2
|
data/lib/savon/soap.rb
CHANGED
@@ -41,6 +41,9 @@ module Savon
|
|
41
41
|
# Accessor for the SOAP action.
|
42
42
|
attr_accessor :action
|
43
43
|
|
44
|
+
# Accessor for the SOAP input.
|
45
|
+
attr_writer :input
|
46
|
+
|
44
47
|
# Sets the SOAP header. Expected to be a Hash that can be translated
|
45
48
|
# to XML via Hash.to_soap_xml or any other Object responding to to_s.
|
46
49
|
attr_writer :header
|
data/spec/savon/soap_spec.rb
CHANGED
@@ -60,6 +60,12 @@ describe Savon::SOAP do
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
+
describe "input" do
|
64
|
+
it "sets the name of the SOAP input node" do
|
65
|
+
@soap.input = "FindUserRequest"
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
63
69
|
describe "header" do
|
64
70
|
it "is an accessor for the SOAP header" do
|
65
71
|
@soap.header.should be_a Hash
|
@@ -137,4 +143,4 @@ describe Savon::SOAP do
|
|
137
143
|
end
|
138
144
|
end
|
139
145
|
|
140
|
-
end
|
146
|
+
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Harrington
|
@@ -71,6 +71,7 @@ extensions: []
|
|
71
71
|
extra_rdoc_files:
|
72
72
|
- README.textile
|
73
73
|
files:
|
74
|
+
- CHANGELOG
|
74
75
|
- README.textile
|
75
76
|
- Rakefile
|
76
77
|
- VERSION
|