savon 0.7.5 → 0.7.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +11 -0
- data/README.rdoc +5 -3
- data/Rakefile +2 -0
- data/lib/savon.rb +1 -0
- data/lib/savon/client.rb +54 -13
- data/lib/savon/core_ext.rb +0 -0
- data/lib/savon/core_ext/array.rb +20 -6
- data/lib/savon/core_ext/datetime.rb +0 -0
- data/lib/savon/core_ext/hash.rb +36 -15
- 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 +9 -2
- data/lib/savon/core_ext/symbol.rb +0 -0
- data/lib/savon/core_ext/uri.rb +1 -1
- data/lib/savon/logger.rb +56 -0
- data/lib/savon/request.rb +42 -50
- data/lib/savon/response.rb +62 -9
- data/lib/savon/soap.rb +157 -42
- data/lib/savon/wsdl.rb +71 -6
- data/lib/savon/wsdl_stream.rb +2 -2
- data/lib/savon/wsse.rb +36 -5
- data/spec/basic_spec_helper.rb +0 -0
- data/spec/endpoint_helper.rb +0 -0
- data/spec/fixtures/response/response_fixture.rb +0 -0
- data/spec/fixtures/response/xml/authentication.xml +0 -0
- data/spec/fixtures/response/xml/multi_ref.xml +0 -0
- data/spec/fixtures/response/xml/soap_fault.xml +0 -0
- data/spec/fixtures/response/xml/soap_fault12.xml +0 -0
- data/spec/fixtures/wsdl/wsdl_fixture.rb +0 -0
- data/spec/fixtures/wsdl/xml/authentication.xml +0 -0
- data/spec/fixtures/wsdl/xml/geotrust.xml +0 -0
- data/spec/fixtures/wsdl/xml/namespaced_actions.xml +0 -0
- data/spec/fixtures/wsdl/xml/no_namespace.xml +0 -0
- data/spec/http_stubs.rb +0 -0
- data/spec/integration/http_basic_auth_spec.rb +0 -0
- data/spec/integration/server.rb +0 -0
- data/spec/savon/client_spec.rb +5 -1
- data/spec/savon/core_ext/array_spec.rb +0 -0
- data/spec/savon/core_ext/datetime_spec.rb +0 -0
- data/spec/savon/core_ext/hash_spec.rb +10 -1
- data/spec/savon/core_ext/net_http_spec.rb +0 -0
- data/spec/savon/core_ext/object_spec.rb +0 -0
- data/spec/savon/core_ext/string_spec.rb +6 -2
- data/spec/savon/core_ext/symbol_spec.rb +0 -0
- data/spec/savon/core_ext/uri_spec.rb +4 -0
- data/spec/savon/request_spec.rb +5 -4
- data/spec/savon/response_spec.rb +0 -0
- data/spec/savon/soap_spec.rb +124 -130
- data/spec/savon/wsdl_spec.rb +0 -0
- data/spec/savon/wsse_spec.rb +0 -0
- data/spec/spec_helper.rb +0 -0
- metadata +55 -37
- data/readme/client.rdoc +0 -18
- data/readme/errors.rdoc +0 -11
- data/readme/logging.rdoc +0 -11
- data/readme/participate.rdoc +0 -21
- data/readme/request.rdoc +0 -37
- data/readme/response.rdoc +0 -46
- data/readme/soap.rdoc +0 -71
- data/readme/value_mapping.rdoc +0 -49
- data/readme/wsdl.rdoc +0 -39
- data/readme/wsse.rdoc +0 -28
data/readme/wsdl.rdoc
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
Savon::WSDL represents the WSDL of your service, including information like the namespace URI and available SOAP actions.
|
2
|
-
|
3
|
-
== Raw WSDL document
|
4
|
-
|
5
|
-
client.wsdl.to_s
|
6
|
-
|
7
|
-
== Available SOAP actions
|
8
|
-
|
9
|
-
client.wsdl.soap_actions
|
10
|
-
=> [:get_all_users, :get_user_by_id]
|
11
|
-
|
12
|
-
== Namespace URI
|
13
|
-
|
14
|
-
client.wsdl.namespace_uri
|
15
|
-
=> "http://ws.userservice.example.com"
|
16
|
-
|
17
|
-
== Disable Savon::WSDL
|
18
|
-
|
19
|
-
Especially with large services (i.e. Ebay), getting and parsing the WSDL document can really slow down your request. So in order to gain performance, you can disable the use of Savon::WSDL by simply appending an exclamation mark (!) to your SOAP call.
|
20
|
-
|
21
|
-
client.get_all_users!
|
22
|
-
|
23
|
-
Disabling Savon::WSDL comes with some disadvantages though. First of all, you need to know and specify the namespace URI of your service per request.
|
24
|
-
|
25
|
-
client.get_user_by_id! do |soap|
|
26
|
-
soap.namespace = "http://example.com/UserService"
|
27
|
-
soap.body = { :id => 666 }
|
28
|
-
end
|
29
|
-
|
30
|
-
Without a WSDL, Savon also has to guess the name of the SOAP action and input. It takes the name of the method called on its client instance, converts it to lowerCamelCase and uses the result. The SOAP call above expects a SOAP action with an original name of "getUserById".
|
31
|
-
|
32
|
-
If that doesn't fit the naming conventions of your service, you need to specify the names yourself. Here is an example request for a SOAP action called "GetUserById", requiring an input tag named "GetUserByIdRequest".
|
33
|
-
|
34
|
-
client.get_user_by_id! do |soap|
|
35
|
-
soap.action = "GetUserById"
|
36
|
-
soap.input = "GetUserByIdRequest"
|
37
|
-
soap.namespace = "http://example.com/UserService"
|
38
|
-
soap.body = { :id => 666 }
|
39
|
-
end
|
data/readme/wsse.rdoc
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
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.
|
2
|
-
|
3
|
-
== Username and password
|
4
|
-
|
5
|
-
By default, Savon does not use WSSE authentication. Simply specify a username and password to change this.
|
6
|
-
|
7
|
-
response = client.get_all_users do |soap, wsse|
|
8
|
-
wsse.username = "gorilla"
|
9
|
-
wsse.password = "secret"
|
10
|
-
end
|
11
|
-
|
12
|
-
== Digest
|
13
|
-
|
14
|
-
To use WSSE digest authentication, just use the digest method to set digest authentication to true.
|
15
|
-
|
16
|
-
response = client.get_all_users do |soap, wsse|
|
17
|
-
wsse.username = "gorilla"
|
18
|
-
wsse.password = "secret"
|
19
|
-
wsse.digest = true
|
20
|
-
end
|
21
|
-
|
22
|
-
== Default to WSSE
|
23
|
-
|
24
|
-
In case all you're services require WSSE authentication, you can set your credentials and whether to use WSSE digest for every request:
|
25
|
-
|
26
|
-
Savon::WSSE.username = "dude"
|
27
|
-
Savon::WSSE.password = "secret"
|
28
|
-
Savon::WSSE.digest = true
|