savon 2.12.0 → 2.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.gitignore +2 -0
- data/CHANGELOG.md +98 -76
- data/CONTRIBUTING.md +15 -19
- data/Gemfile +2 -7
- data/README.md +15 -19
- data/RELEASING.md +10 -0
- data/lib/savon/block_interface.rb +1 -0
- data/lib/savon/builder.rb +98 -29
- data/lib/savon/client.rb +1 -0
- data/lib/savon/core_ext/string.rb +1 -0
- data/lib/savon/header.rb +2 -6
- data/lib/savon/http_error.rb +4 -4
- data/lib/savon/log_message.rb +1 -0
- data/lib/savon/message.rb +1 -0
- data/lib/savon/mock/expectation.rb +1 -0
- data/lib/savon/mock/spec_helper.rb +1 -0
- data/lib/savon/mock.rb +1 -0
- data/lib/savon/model.rb +1 -0
- data/lib/savon/operation.rb +20 -18
- data/lib/savon/options.rb +56 -0
- data/lib/savon/qualified_message.rb +4 -3
- data/lib/savon/request.rb +5 -0
- data/lib/savon/request_logger.rb +8 -2
- data/lib/savon/response.rb +48 -1
- data/lib/savon/soap_fault.rb +2 -1
- data/lib/savon/version.rb +2 -1
- data/lib/savon.rb +1 -0
- data/savon.gemspec +9 -8
- data/spec/fixtures/response/empty_soap_fault.xml +13 -0
- data/spec/fixtures/wsdl/elements_in_types.xml +43 -0
- data/spec/integration/support/application.rb +33 -1
- data/spec/integration/support/server.rb +1 -0
- data/spec/integration/zipcode_example_spec.rb +5 -8
- data/spec/savon/builder_spec.rb +2 -1
- data/spec/savon/client_spec.rb +5 -4
- data/spec/savon/core_ext/string_spec.rb +2 -1
- data/spec/savon/features/message_tag_spec.rb +2 -1
- data/spec/savon/http_error_spec.rb +9 -1
- data/spec/savon/log_message_spec.rb +2 -1
- data/spec/savon/message_spec.rb +2 -11
- data/spec/savon/mock_spec.rb +2 -1
- data/spec/savon/model_spec.rb +2 -1
- data/spec/savon/multipart_request_spec.rb +46 -0
- data/spec/savon/observers_spec.rb +2 -1
- data/spec/savon/operation_spec.rb +20 -43
- data/spec/savon/options_spec.rb +51 -1
- data/spec/savon/qualified_message_spec.rb +2 -1
- data/spec/savon/request_logger_spec.rb +2 -1
- data/spec/savon/request_spec.rb +47 -6
- data/spec/savon/response_spec.rb +2 -1
- data/spec/savon/soap_fault_spec.rb +12 -1
- data/spec/savon/softlayer_spec.rb +17 -2
- data/spec/spec_helper.rb +5 -4
- data/spec/support/adapters.rb +1 -0
- data/spec/support/endpoint.rb +1 -0
- data/spec/support/fixture.rb +1 -0
- data/spec/support/integration.rb +1 -0
- data/spec/support/stdout.rb +1 -0
- metadata +57 -34
- data/.travis.yml +0 -18
- data/donate.png +0 -0
- data/spec/integration/centra_spec.rb +0 -67
- data/spec/integration/email_example_spec.rb +0 -32
- data/spec/integration/random_quote_spec.rb +0 -23
- data/spec/integration/ratp_example_spec.rb +0 -28
- data/spec/integration/stockquote_example_spec.rb +0 -34
- data/spec/integration/temperature_example_spec.rb +0 -46
@@ -1,32 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "Email example" do
|
4
|
-
|
5
|
-
it "passes Strings as they are" do
|
6
|
-
client = Savon.client(
|
7
|
-
# The WSDL document provided by the service.
|
8
|
-
:wsdl => "http://ws.cdyne.com/emailverify/Emailvernotestemail.asmx?wsdl",
|
9
|
-
|
10
|
-
# Lower timeouts so these specs don't take forever when the service is not available.
|
11
|
-
:open_timeout => 10,
|
12
|
-
:read_timeout => 10,
|
13
|
-
|
14
|
-
# Disable logging for cleaner spec output.
|
15
|
-
:log => false
|
16
|
-
)
|
17
|
-
|
18
|
-
response = call_and_fail_gracefully(client, :verify_email, :message => { :email => "soap@example.com", "LicenseKey" => "?" })
|
19
|
-
|
20
|
-
response_text = response.body[:verify_email_response][:verify_email_result][:response_text]
|
21
|
-
|
22
|
-
if response_text == "Current license key only allows so many checks"
|
23
|
-
# Fallback to not fail the specs when the service's API limit is reached,
|
24
|
-
# but to mark the spec as pending instead.
|
25
|
-
pending "API limit exceeded"
|
26
|
-
else
|
27
|
-
# The expected result. We unfortunately don't have a license key for this service.
|
28
|
-
expect(response_text).to eq("Email Domain Not Found")
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'rpc/encoded binding test' do
|
4
|
-
|
5
|
-
it 'should should work with WSDLs that have rpc/encoded SOAP binding' do
|
6
|
-
client = Savon.client(
|
7
|
-
:wsdl => "http://www.boyzoid.com/comp/randomQuote.cfc?wsdl",
|
8
|
-
:open_timeout => 10,
|
9
|
-
:read_timeout => 10,
|
10
|
-
:log => false
|
11
|
-
)
|
12
|
-
|
13
|
-
begin
|
14
|
-
client.call(:get_quote)
|
15
|
-
rescue Savon::SOAPFault => e
|
16
|
-
$stderr.puts e.to_hash.inspect
|
17
|
-
f_c = e.to_hash[:fault][:faultstring]
|
18
|
-
expect(f_c).not_to eq('No such operation \'getQuoteRequest\'')
|
19
|
-
expect(f_c).to eq('lucee.runtime.exp.DatabaseException: ')
|
20
|
-
pending e
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "RATP example" do
|
4
|
-
|
5
|
-
it "retrieves information about a specific station" do
|
6
|
-
client = Savon.client do
|
7
|
-
# The WSDL document provided by the service.
|
8
|
-
wsdl "http://www.ratp.fr/wsiv/services/Wsiv?wsdl"
|
9
|
-
|
10
|
-
# Lower timeouts so these specs don't take forever when the service is not available.
|
11
|
-
open_timeout 10
|
12
|
-
read_timeout 10
|
13
|
-
|
14
|
-
# Disable logging for cleaner spec output.
|
15
|
-
log false
|
16
|
-
end
|
17
|
-
|
18
|
-
# XXX: the service seems to rely on the order of arguments.
|
19
|
-
# try to fix this with the new wsdl parser.
|
20
|
-
response = call_and_fail_gracefully(client, :get_stations) do
|
21
|
-
message(:station => { :id => 1975 }, :limit => 1)
|
22
|
-
end
|
23
|
-
|
24
|
-
station_name = response.body[:get_stations_response][:return][:stations][:name]
|
25
|
-
expect(station_name).to eq("Cite")
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "Stockquote example" do
|
4
|
-
|
5
|
-
it "returns the result in a CDATA tag" do
|
6
|
-
client = Savon.client(
|
7
|
-
# The WSDL document provided by the service.
|
8
|
-
:wsdl => "http://www.webservicex.net/stockquote.asmx?WSDL",
|
9
|
-
|
10
|
-
# Lower timeouts so these specs don't take forever when the service is not available.
|
11
|
-
:open_timeout => 10,
|
12
|
-
:read_timeout => 10,
|
13
|
-
|
14
|
-
# Disable logging for cleaner spec output.
|
15
|
-
:log => false
|
16
|
-
)
|
17
|
-
|
18
|
-
response = call_and_fail_gracefully(client, :get_quote, :message => { :symbol => "AAPL" })
|
19
|
-
|
20
|
-
cdata = response.body[:get_quote_response][:get_quote_result]
|
21
|
-
|
22
|
-
if cdata == "exception"
|
23
|
-
# Fallback to not fail the specs when the service's API limit is reached,
|
24
|
-
# but to mark the spec as pending instead.
|
25
|
-
pending "Exception on API"
|
26
|
-
end
|
27
|
-
|
28
|
-
nori_options = { :convert_tags_to => lambda { |tag| tag.snakecase.to_sym } }
|
29
|
-
result = Nori.new(nori_options).parse(cdata)
|
30
|
-
|
31
|
-
expect(result[:stock_quotes][:stock][:symbol]).to eq("AAPL")
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "Temperature example" do
|
4
|
-
|
5
|
-
it "converts 30 degrees celsius to 86 degrees fahrenheit" do
|
6
|
-
client = Savon.client do
|
7
|
-
# The WSDL document provided by the service.
|
8
|
-
wsdl "http://www.webservicex.net/ConvertTemperature.asmx?WSDL"
|
9
|
-
|
10
|
-
# Needed because (up until now), Savon doesn't match XS types to Hash keys,
|
11
|
-
# but defaults to convert Hash message Symbols (like :from_unit) to lowerCamelCase.
|
12
|
-
# The service expects these to be CamelCase instead. Look at Savon's log output
|
13
|
-
# and compare it with an example request generated by soapUI.
|
14
|
-
convert_request_keys_to :camelcase
|
15
|
-
|
16
|
-
# Lower timeouts so these specs don't take forever when the service is not available.
|
17
|
-
open_timeout 10
|
18
|
-
read_timeout 10
|
19
|
-
|
20
|
-
# Disable logging for cleaner spec output.
|
21
|
-
log false
|
22
|
-
end
|
23
|
-
|
24
|
-
response = call_and_fail_gracefully(client, :convert_temp) do
|
25
|
-
# For the corrent values to pass for :from_unit and :to_unit, I searched the WSDL for
|
26
|
-
# the "FromUnit" type which is a "TemperatureUnit" enumeration that looks like this:
|
27
|
-
#
|
28
|
-
# <s:simpleType name="TemperatureUnit">
|
29
|
-
# <s:restriction base="s:string">
|
30
|
-
# <s:enumeration value="degreeCelsius"/>
|
31
|
-
# <s:enumeration value="degreeFahrenheit"/>
|
32
|
-
# <s:enumeration value="degreeRankine"/>
|
33
|
-
# <s:enumeration value="degreeReaumur"/>
|
34
|
-
# <s:enumeration value="kelvin"/>
|
35
|
-
# </s:restriction>
|
36
|
-
# </s:simpleType>
|
37
|
-
#
|
38
|
-
# Support for XS schema types needs to be improved.
|
39
|
-
message(:temperature => 30, :from_unit => "degreeCelsius", :to_unit => "degreeFahrenheit")
|
40
|
-
end
|
41
|
-
|
42
|
-
fahrenheit = response.body[:convert_temp_response][:convert_temp_result]
|
43
|
-
expect(fahrenheit).to eq("86")
|
44
|
-
end
|
45
|
-
|
46
|
-
end
|