sekken 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.travis.yml +11 -0
- data/.yardopts +6 -0
- data/CONTRIBUTING.md +46 -0
- data/Gemfile +27 -0
- data/MIT-LICENSE +20 -0
- data/README.md +28 -0
- data/Rakefile +21 -0
- data/donate.png +0 -0
- data/lib/sekken.rb +75 -0
- data/lib/sekken/envelope.rb +92 -0
- data/lib/sekken/errors.rb +9 -0
- data/lib/sekken/example_message.rb +41 -0
- data/lib/sekken/httpclient.rb +35 -0
- data/lib/sekken/importer.rb +77 -0
- data/lib/sekken/message.rb +135 -0
- data/lib/sekken/operation.rb +100 -0
- data/lib/sekken/resolver.rb +20 -0
- data/lib/sekken/response.rb +50 -0
- data/lib/sekken/version.rb +5 -0
- data/lib/sekken/wsdl.rb +86 -0
- data/lib/sekken/wsdl/binding.rb +64 -0
- data/lib/sekken/wsdl/binding_operation.rb +85 -0
- data/lib/sekken/wsdl/document.rb +83 -0
- data/lib/sekken/wsdl/document_collection.rb +61 -0
- data/lib/sekken/wsdl/input_output.rb +84 -0
- data/lib/sekken/wsdl/message.rb +38 -0
- data/lib/sekken/wsdl/operation.rb +47 -0
- data/lib/sekken/wsdl/port.rb +29 -0
- data/lib/sekken/wsdl/port_type.rb +38 -0
- data/lib/sekken/wsdl/port_type_operation.rb +42 -0
- data/lib/sekken/wsdl/service.rb +55 -0
- data/lib/sekken/xml/attribute.rb +13 -0
- data/lib/sekken/xml/element.rb +82 -0
- data/lib/sekken/xml/element_builder.rb +220 -0
- data/lib/sekken/xs/schema.rb +57 -0
- data/lib/sekken/xs/schema_collection.rb +49 -0
- data/lib/sekken/xs/types.rb +272 -0
- data/sekken.gemspec +42 -0
- data/spec/fixtures/response/another_soap_fault.xml +14 -0
- data/spec/fixtures/response/authentication.xml +14 -0
- data/spec/fixtures/response/header.xml +13 -0
- data/spec/fixtures/response/list.xml +18 -0
- data/spec/fixtures/response/multi_ref.xml +39 -0
- data/spec/fixtures/response/soap_fault.xml +8 -0
- data/spec/fixtures/response/soap_fault12.xml +18 -0
- data/spec/fixtures/response/taxcloud.xml +1 -0
- data/spec/fixtures/wsdl/amazon.wsdl +1920 -0
- data/spec/fixtures/wsdl/arrays_with_attributes.wsdl +117 -0
- data/spec/fixtures/wsdl/authentication.wsdl +63 -0
- data/spec/fixtures/wsdl/awse.wsdl +1510 -0
- data/spec/fixtures/wsdl/betfair.wsdl +2981 -0
- data/spec/fixtures/wsdl/blz_service.wsdl +88 -0
- data/spec/fixtures/wsdl/bookt/bookt.wsdl +11 -0
- data/spec/fixtures/wsdl/bookt/bookt0.xsd +433 -0
- data/spec/fixtures/wsdl/bookt/bookt1.xsd +42 -0
- data/spec/fixtures/wsdl/bookt/bookt10.xsd +38 -0
- data/spec/fixtures/wsdl/bookt/bookt11.xsd +17 -0
- data/spec/fixtures/wsdl/bookt/bookt12.xsd +18 -0
- data/spec/fixtures/wsdl/bookt/bookt13.xsd +22 -0
- data/spec/fixtures/wsdl/bookt/bookt14.xsd +27 -0
- data/spec/fixtures/wsdl/bookt/bookt15.xsd +28 -0
- data/spec/fixtures/wsdl/bookt/bookt2.wsdl +243 -0
- data/spec/fixtures/wsdl/bookt/bookt2.xsd +81 -0
- data/spec/fixtures/wsdl/bookt/bookt3.wsdl +286 -0
- data/spec/fixtures/wsdl/bookt/bookt3.xsd +61 -0
- data/spec/fixtures/wsdl/bookt/bookt4.xsd +35 -0
- data/spec/fixtures/wsdl/bookt/bookt5.xsd +22 -0
- data/spec/fixtures/wsdl/bookt/bookt6.xsd +26 -0
- data/spec/fixtures/wsdl/bookt/bookt7.xsd +18 -0
- data/spec/fixtures/wsdl/bookt/bookt8.xsd +22 -0
- data/spec/fixtures/wsdl/bookt/bookt9.xsd +29 -0
- data/spec/fixtures/wsdl/bronto.wsdl +3285 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange.wsdl +104 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange0.xsd +1 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange1.xsd +1 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange2.wsdl +119 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange2.xsd +1 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange3.xsd +1 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange4.xsd +1 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange5.xsd +1 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange6.xsd +1 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange7.xsd +1 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange8.xsd +1 -0
- data/spec/fixtures/wsdl/crowd.wsdl +2437 -0
- data/spec/fixtures/wsdl/data_exchange.wsdl +98 -0
- data/spec/fixtures/wsdl/document_literal_wrapped.wsdl +153 -0
- data/spec/fixtures/wsdl/economic.wsdl +65660 -0
- data/spec/fixtures/wsdl/edialog.wsdl +13148 -0
- data/spec/fixtures/wsdl/email_verification.wsdl +394 -0
- data/spec/fixtures/wsdl/equifax.wsdl +794 -0
- data/spec/fixtures/wsdl/geotrust.wsdl +156 -0
- data/spec/fixtures/wsdl/interhome.wsdl +2137 -0
- data/spec/fixtures/wsdl/iws.wsdl +695 -0
- data/spec/fixtures/wsdl/jetairways.wsdl +156 -0
- data/spec/fixtures/wsdl/jira.wsdl +3890 -0
- data/spec/fixtures/wsdl/juniper.wsdl +215 -0
- data/spec/fixtures/wsdl/namespaced_actions.wsdl +307 -0
- data/spec/fixtures/wsdl/oracle.wsdl +3629 -0
- data/spec/fixtures/wsdl/ratp.wsdl +955 -0
- data/spec/fixtures/wsdl/rio2/rio2.wsdl +74 -0
- data/spec/fixtures/wsdl/rio2/rio2_0.wsdl +55 -0
- data/spec/fixtures/wsdl/rio2/rio2_0.xsd +58 -0
- data/spec/fixtures/wsdl/rio2/rio2_1.xsd +41 -0
- data/spec/fixtures/wsdl/rio2/rio2_2.xsd +222 -0
- data/spec/fixtures/wsdl/rio2/rio2_3.xsd +10 -0
- data/spec/fixtures/wsdl/rpc_literal.wsdl +105 -0
- data/spec/fixtures/wsdl/spyne.wsdl +70 -0
- data/spec/fixtures/wsdl/stockquote.wsdl +124 -0
- data/spec/fixtures/wsdl/taxcloud.wsdl +934 -0
- data/spec/fixtures/wsdl/team_software/team_software.wsdl +542 -0
- data/spec/fixtures/wsdl/team_software/team_software0.xsd +448 -0
- data/spec/fixtures/wsdl/team_software/team_software1.xsd +41 -0
- data/spec/fixtures/wsdl/team_software/team_software2.xsd +258 -0
- data/spec/fixtures/wsdl/team_software/team_software3.xsd +14 -0
- data/spec/fixtures/wsdl/telefonkatalogen.wsdl +45 -0
- data/spec/fixtures/wsdl/temperature.wsdl +136 -0
- data/spec/fixtures/wsdl/wasmuth/wasmuth.wsdl +157 -0
- data/spec/fixtures/wsdl/wasmuth/wasmuth1.xsd +210 -0
- data/spec/fixtures/wsdl/wasmuth/wasmuth2.xsd +549 -0
- data/spec/fixtures/wsdl/xignite.wsdl +3470 -0
- data/spec/fixtures/wsdl/yahoo.wsdl +2425 -0
- data/spec/fixtures/wsdl/zanox_export_service.xml +520 -0
- data/spec/integration/amazon_spec.rb +51 -0
- data/spec/integration/authentication_spec.rb +38 -0
- data/spec/integration/awse_spec.rb +95 -0
- data/spec/integration/betfair_spec.rb +179 -0
- data/spec/integration/blz_service_spec.rb +46 -0
- data/spec/integration/bookt_spec.rb +59 -0
- data/spec/integration/bronto_spec.rb +178 -0
- data/spec/integration/bydexchange_spec.rb +40 -0
- data/spec/integration/crowd_spec.rb +44 -0
- data/spec/integration/data_exchange_spec.rb +27 -0
- data/spec/integration/document_literal_spec.rb +104 -0
- data/spec/integration/economic_spec.rb +64 -0
- data/spec/integration/email_verification_spec.rb +82 -0
- data/spec/integration/equifax_spec.rb +216 -0
- data/spec/integration/geotrust_spec.rb +17 -0
- data/spec/integration/interhome_spec.rb +156 -0
- data/spec/integration/iws_spec.rb +27 -0
- data/spec/integration/jetairways_spec.rb +142 -0
- data/spec/integration/jira_spec.rb +27 -0
- data/spec/integration/juniper_spec.rb +20 -0
- data/spec/integration/namespaced_actions_spec.rb +37 -0
- data/spec/integration/oracle_spec.rb +61 -0
- data/spec/integration/ratp_spec.rb +178 -0
- data/spec/integration/rio2_spec.rb +56 -0
- data/spec/integration/rpc_literal_spec.rb +101 -0
- data/spec/integration/spyne_spec.rb +60 -0
- data/spec/integration/stockquote_spec.rb +46 -0
- data/spec/integration/taxcloud_spec.rb +45 -0
- data/spec/integration/team_software_spec.rb +51 -0
- data/spec/integration/telefonkatalogen_spec.rb +42 -0
- data/spec/integration/temperature_spec.rb +71 -0
- data/spec/integration/wasmuth_spec.rb +47 -0
- data/spec/integration/xignite_spec.rb +112 -0
- data/spec/integration/yahoo_spec.rb +116 -0
- data/spec/sekken/httpclient_spec.rb +41 -0
- data/spec/sekken/operation/build_spec.rb +308 -0
- data/spec/sekken/operation/document_literal_spec.rb +53 -0
- data/spec/sekken/operation/example_body_spec.rb +95 -0
- data/spec/sekken/operation/rpc_literal_spec.rb +50 -0
- data/spec/sekken/operation_spec.rb +169 -0
- data/spec/sekken/resolver_spec.rb +38 -0
- data/spec/sekken/response_spec.rb +17 -0
- data/spec/sekken/wsdl/document_spec.rb +191 -0
- data/spec/sekken/wsdl_spec.rb +46 -0
- data/spec/sekken/xs/complex_type_spec.rb +197 -0
- data/spec/sekken/xs/element_spec.rb +82 -0
- data/spec/sekken/xs/simple_type_spec.rb +39 -0
- data/spec/sekken_spec.rb +128 -0
- data/spec/spec_helper.rb +37 -0
- data/spec/support/fixture.rb +19 -0
- data/spec/support/http_mock.rb +43 -0
- metadata +344 -0
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Integration with Amazon' do
|
4
|
+
|
5
|
+
subject(:client) { Sekken.new fixture('wsdl/amazon') }
|
6
|
+
|
7
|
+
it 'returns a map of services and ports' do
|
8
|
+
expect(client.services).to eq(
|
9
|
+
'AmazonFPS' => {
|
10
|
+
:ports => {
|
11
|
+
'AmazonFPSPort' => {
|
12
|
+
:type => 'http://schemas.xmlsoap.org/wsdl/soap/',
|
13
|
+
:location => 'https://fps.amazonaws.com'
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
)
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'knows the operations' do
|
21
|
+
service, port = 'AmazonFPS', 'AmazonFPSPort'
|
22
|
+
operation = client.operation(service, port, 'Pay')
|
23
|
+
|
24
|
+
expect(operation.soap_action).to eq('Pay')
|
25
|
+
expect(operation.endpoint).to eq('https://fps.amazonaws.com')
|
26
|
+
|
27
|
+
namespace = 'http://fps.amazonaws.com/doc/2008-09-17/'
|
28
|
+
|
29
|
+
expect(operation.body_parts).to eq([
|
30
|
+
[['Pay'], { namespace: namespace, form: 'qualified', singular: true }],
|
31
|
+
[['Pay', 'SenderTokenId'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
32
|
+
[['Pay', 'RecipientTokenId'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
33
|
+
[['Pay', 'TransactionAmount'], { namespace: namespace, form: 'qualified', singular: true }],
|
34
|
+
[['Pay', 'TransactionAmount', 'CurrencyCode'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
35
|
+
[['Pay', 'TransactionAmount', 'Value'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
36
|
+
[['Pay', 'ChargeFeeTo'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
37
|
+
[['Pay', 'CallerReference'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
38
|
+
[['Pay', 'CallerDescription'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
39
|
+
[['Pay', 'SenderDescription'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
40
|
+
[['Pay', 'DescriptorPolicy'], { namespace: namespace, form: 'qualified', singular: true }],
|
41
|
+
[['Pay', 'DescriptorPolicy', 'SoftDescriptorType'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
42
|
+
[['Pay', 'DescriptorPolicy', 'CSOwner'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
43
|
+
[['Pay', 'TransactionTimeoutInMins'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:integer' }],
|
44
|
+
[['Pay', 'MarketplaceFixedFee'], { namespace: namespace, form: 'qualified', singular: true }],
|
45
|
+
[['Pay', 'MarketplaceFixedFee', 'CurrencyCode'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
46
|
+
[['Pay', 'MarketplaceFixedFee', 'Value'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
47
|
+
[['Pay', 'MarketplaceVariableFee'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:decimal' }]
|
48
|
+
])
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Integration with Authentication service' do
|
4
|
+
|
5
|
+
subject(:client) { Sekken.new fixture('wsdl/authentication') }
|
6
|
+
|
7
|
+
it 'returns a map of services and ports' do
|
8
|
+
expect(client.services).to eq(
|
9
|
+
'AuthenticationWebServiceImplService' => {
|
10
|
+
:ports => {
|
11
|
+
'AuthenticationWebServiceImplPort' => {
|
12
|
+
:type => 'http://schemas.xmlsoap.org/wsdl/soap/',
|
13
|
+
:location => 'http://example.com/validation/1.0/AuthenticationService'
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
)
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'knows the operations' do
|
21
|
+
service = 'AuthenticationWebServiceImplService'
|
22
|
+
port = 'AuthenticationWebServiceImplPort'
|
23
|
+
|
24
|
+
operation = client.operation(service, port, 'authenticate')
|
25
|
+
|
26
|
+
expect(operation.soap_action).to eq('')
|
27
|
+
expect(operation.endpoint).to eq('http://example.com/validation/1.0/AuthenticationService')
|
28
|
+
|
29
|
+
namespace = 'http://v1_0.ws.auth.order.example.com/'
|
30
|
+
|
31
|
+
expect(operation.body_parts).to eq([
|
32
|
+
[['authenticate'], { namespace: namespace, form: 'qualified', singular: true }],
|
33
|
+
[['authenticate', 'user'], { namespace: namespace, form: 'unqualified', singular: true, type: 'xs:string' }],
|
34
|
+
[['authenticate', 'password'], { namespace: namespace, form: 'unqualified', singular: true, type: 'xs:string' }]
|
35
|
+
])
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Integration with AWSE' do
|
4
|
+
|
5
|
+
subject(:client) { Sekken.new fixture('wsdl/awse') }
|
6
|
+
|
7
|
+
it 'returns a map of services and ports' do
|
8
|
+
expect(client.services).to eq(
|
9
|
+
'AWSECommerceService' => {
|
10
|
+
ports: {
|
11
|
+
'AWSECommerceServicePort' => {
|
12
|
+
type: 'http://schemas.xmlsoap.org/wsdl/soap/',
|
13
|
+
location: 'https://webservices.amazon.com/onca/soap?Service=AWSECommerceService'
|
14
|
+
},
|
15
|
+
'AWSECommerceServicePortCA' => {
|
16
|
+
type: 'http://schemas.xmlsoap.org/wsdl/soap/',
|
17
|
+
location: 'https://webservices.amazon.ca/onca/soap?Service=AWSECommerceService'
|
18
|
+
},
|
19
|
+
'AWSECommerceServicePortCN' => {
|
20
|
+
type: 'http://schemas.xmlsoap.org/wsdl/soap/',
|
21
|
+
location: 'https://webservices.amazon.cn/onca/soap?Service=AWSECommerceService'
|
22
|
+
},
|
23
|
+
'AWSECommerceServicePortDE' => {
|
24
|
+
type: 'http://schemas.xmlsoap.org/wsdl/soap/',
|
25
|
+
location: 'https://webservices.amazon.de/onca/soap?Service=AWSECommerceService'
|
26
|
+
},
|
27
|
+
'AWSECommerceServicePortFR' => {
|
28
|
+
type: 'http://schemas.xmlsoap.org/wsdl/soap/',
|
29
|
+
location: 'https://webservices.amazon.fr/onca/soap?Service=AWSECommerceService'
|
30
|
+
},
|
31
|
+
'AWSECommerceServicePortIT' => {
|
32
|
+
type: 'http://schemas.xmlsoap.org/wsdl/soap/',
|
33
|
+
location: 'https://webservices.amazon.it/onca/soap?Service=AWSECommerceService'
|
34
|
+
},
|
35
|
+
'AWSECommerceServicePortJP' => {
|
36
|
+
type: 'http://schemas.xmlsoap.org/wsdl/soap/',
|
37
|
+
location: 'https://webservices.amazon.co.jp/onca/soap?Service=AWSECommerceService'
|
38
|
+
},
|
39
|
+
'AWSECommerceServicePortUK' => {
|
40
|
+
type: 'http://schemas.xmlsoap.org/wsdl/soap/',
|
41
|
+
location: 'https://webservices.amazon.co.uk/onca/soap?Service=AWSECommerceService'
|
42
|
+
},
|
43
|
+
'AWSECommerceServicePortUS' => {
|
44
|
+
type: 'http://schemas.xmlsoap.org/wsdl/soap/',
|
45
|
+
location: 'https://webservices.amazon.com/onca/soap?Service=AWSECommerceService'
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'knows the operations' do
|
53
|
+
service, port = 'AWSECommerceService', 'AWSECommerceServicePort'
|
54
|
+
operation = client.operation(service, port, 'CartAdd')
|
55
|
+
|
56
|
+
expect(operation.soap_action).to eq('http://soap.amazon.com/CartAdd')
|
57
|
+
expect(operation.endpoint).to eq('https://webservices.amazon.com/onca/soap?Service=AWSECommerceService')
|
58
|
+
|
59
|
+
namespace = 'http://webservices.amazon.com/AWSECommerceService/2011-08-01'
|
60
|
+
|
61
|
+
expect(operation.body_parts).to eq([
|
62
|
+
[['CartAdd'], { namespace: namespace, form: 'qualified', singular: true }],
|
63
|
+
[['CartAdd', 'MarketplaceDomain'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
64
|
+
[['CartAdd', 'AWSAccessKeyId'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
65
|
+
[['CartAdd', 'AssociateTag'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
66
|
+
[['CartAdd', 'Validate'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
67
|
+
[['CartAdd', 'XMLEscaping'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
68
|
+
[['CartAdd', 'Shared'], { namespace: namespace, form: 'qualified', singular: true }],
|
69
|
+
[['CartAdd', 'Shared', 'CartId'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
70
|
+
[['CartAdd', 'Shared', 'HMAC'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
71
|
+
[['CartAdd', 'Shared', 'MergeCart'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
72
|
+
[['CartAdd', 'Shared', 'Items'], { namespace: namespace, form: 'qualified', singular: true }],
|
73
|
+
[['CartAdd', 'Shared', 'Items', 'Item'], { namespace: namespace, form: 'qualified', singular: false }],
|
74
|
+
[['CartAdd', 'Shared', 'Items', 'Item', 'ASIN'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
75
|
+
[['CartAdd', 'Shared', 'Items', 'Item', 'OfferListingId'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
76
|
+
[['CartAdd', 'Shared', 'Items', 'Item', 'Quantity'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:positiveInteger' }],
|
77
|
+
[['CartAdd', 'Shared', 'Items', 'Item', 'AssociateTag'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
78
|
+
[['CartAdd', 'Shared', 'Items', 'Item', 'ListItemId'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
79
|
+
[['CartAdd', 'Shared', 'ResponseGroup'], { namespace: namespace, form: 'qualified', singular: false, type: 'xs:string' }],
|
80
|
+
[['CartAdd', 'Request'], { namespace: namespace, form: 'qualified', singular: false }],
|
81
|
+
[['CartAdd', 'Request', 'CartId'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
82
|
+
[['CartAdd', 'Request', 'HMAC'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
83
|
+
[['CartAdd', 'Request', 'MergeCart'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
84
|
+
[['CartAdd', 'Request', 'Items'], { namespace: namespace, form: 'qualified', singular: true }],
|
85
|
+
[['CartAdd', 'Request', 'Items', 'Item'], { namespace: namespace, form: 'qualified', singular: false }],
|
86
|
+
[['CartAdd', 'Request', 'Items', 'Item', 'ASIN'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
87
|
+
[['CartAdd', 'Request', 'Items', 'Item', 'OfferListingId'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
88
|
+
[['CartAdd', 'Request', 'Items', 'Item', 'Quantity'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:positiveInteger' }],
|
89
|
+
[['CartAdd', 'Request', 'Items', 'Item', 'AssociateTag'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
90
|
+
[['CartAdd', 'Request', 'Items', 'Item', 'ListItemId'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
91
|
+
[['CartAdd', 'Request', 'ResponseGroup'], { namespace: namespace, form: 'qualified', singular: false, type: 'xs:string' }]
|
92
|
+
])
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
@@ -0,0 +1,179 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Integration with Betfair' do
|
4
|
+
|
5
|
+
subject(:client) { Sekken.new fixture('wsdl/betfair') }
|
6
|
+
|
7
|
+
let(:service_name) { :BFExchangeService }
|
8
|
+
let(:port_name) { :BFExchangeService }
|
9
|
+
|
10
|
+
it 'returns a map of services and ports' do
|
11
|
+
expect(client.services).to eq(
|
12
|
+
'BFExchangeService' => {
|
13
|
+
:ports => {
|
14
|
+
'BFExchangeService' => {
|
15
|
+
:type => 'http://schemas.xmlsoap.org/wsdl/soap/',
|
16
|
+
:location => 'https://api.betfair.com/exchange/v5/BFExchangeService'
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'knows operations with extensions and Arrays' do
|
24
|
+
service = port = 'BFExchangeService'
|
25
|
+
operation = client.operation(service, port, 'getMUBetsLite')
|
26
|
+
|
27
|
+
expect(operation.soap_action).to eq('getMUBetsLite')
|
28
|
+
expect(operation.endpoint).to eq('https://api.betfair.com/exchange/v5/BFExchangeService')
|
29
|
+
|
30
|
+
ns = 'http://www.betfair.com/publicapi/v5/BFExchangeService/'
|
31
|
+
ns2 = 'http://www.betfair.com/publicapi/types/exchange/v5/'
|
32
|
+
|
33
|
+
expect(operation.body_parts).to eq([
|
34
|
+
[['getMUBetsLite'],
|
35
|
+
{ namespace: ns, form: 'qualified', singular: true }],
|
36
|
+
|
37
|
+
[['getMUBetsLite', 'request'],
|
38
|
+
{ namespace: ns, form: 'qualified', singular: true }],
|
39
|
+
|
40
|
+
# extension elements
|
41
|
+
|
42
|
+
[['getMUBetsLite', 'request', 'header'],
|
43
|
+
{ namespace: ns2, form: 'unqualified', singular: true }],
|
44
|
+
|
45
|
+
[['getMUBetsLite', 'request', 'header', 'clientStamp'],
|
46
|
+
{ namespace: ns2, form: 'unqualified', singular: true, type: 'xsd:long' }],
|
47
|
+
|
48
|
+
[['getMUBetsLite', 'request', 'header', 'sessionToken'],
|
49
|
+
{ namespace: ns2, form: 'unqualified', singular: true, type: 'xsd:string' }],
|
50
|
+
|
51
|
+
# ---
|
52
|
+
|
53
|
+
[['getMUBetsLite', 'request', 'betStatus'],
|
54
|
+
{ namespace: ns2, form: 'unqualified', singular: true, type: 'xsd:string' }],
|
55
|
+
|
56
|
+
[['getMUBetsLite', 'request', 'marketId'],
|
57
|
+
{ namespace: ns2, form: 'unqualified', singular: true, type: 'xsd:int' }],
|
58
|
+
|
59
|
+
[['getMUBetsLite', 'request', 'betIds'],
|
60
|
+
{ namespace: ns2, form: 'unqualified', singular: true }],
|
61
|
+
|
62
|
+
[['getMUBetsLite', 'request', 'betIds', 'betId'],
|
63
|
+
{ namespace: ns2, form: 'qualified', singular: false, type: 'xsd:long' }],
|
64
|
+
|
65
|
+
[['getMUBetsLite', 'request', 'orderBy'],
|
66
|
+
{ namespace: ns2, form: 'unqualified', singular: true, type: 'xsd:string' }],
|
67
|
+
|
68
|
+
[['getMUBetsLite', 'request', 'sortOrder'],
|
69
|
+
{ namespace: ns2, form: 'unqualified', singular: true, type: 'xsd:string' }],
|
70
|
+
|
71
|
+
[['getMUBetsLite', 'request', 'recordCount'],
|
72
|
+
{ namespace: ns2, form: 'unqualified', singular: true, type: 'xsd:int' }],
|
73
|
+
|
74
|
+
[['getMUBetsLite', 'request', 'startRecord'],
|
75
|
+
{ namespace: ns2, form: 'unqualified', singular: true, type: 'xsd:int' }],
|
76
|
+
|
77
|
+
[['getMUBetsLite', 'request', 'matchedSince'],
|
78
|
+
{ namespace: ns2, form: 'unqualified', singular: true, type: 'xsd:dateTime' }],
|
79
|
+
|
80
|
+
[['getMUBetsLite', 'request', 'excludeLastSecond'],
|
81
|
+
{ namespace: ns2, form: 'unqualified', singular: true, type: 'xsd:boolean' }]
|
82
|
+
])
|
83
|
+
end
|
84
|
+
|
85
|
+
it 'creates a proper example request for messages with Arrays' do
|
86
|
+
operation = client.operation(service_name, port_name, :getMUBetsLite)
|
87
|
+
|
88
|
+
expect(operation.example_body).to eq(
|
89
|
+
getMUBetsLite: {
|
90
|
+
request: {
|
91
|
+
|
92
|
+
# This is an extension
|
93
|
+
header: {
|
94
|
+
clientStamp: 'long',
|
95
|
+
sessionToken: 'string'
|
96
|
+
},
|
97
|
+
|
98
|
+
betStatus: 'string',
|
99
|
+
marketId: 'int',
|
100
|
+
betIds: {
|
101
|
+
|
102
|
+
# This is an Array of simpleTypes
|
103
|
+
betId: ['long']
|
104
|
+
|
105
|
+
},
|
106
|
+
orderBy: 'string',
|
107
|
+
sortOrder: 'string',
|
108
|
+
recordCount: 'int',
|
109
|
+
startRecord: 'int',
|
110
|
+
matchedSince: 'dateTime',
|
111
|
+
excludeLastSecond: 'boolean'
|
112
|
+
}
|
113
|
+
}
|
114
|
+
)
|
115
|
+
end
|
116
|
+
|
117
|
+
it 'builds a request for extensions and Arrays' do
|
118
|
+
operation = client.operation(service_name, port_name, :getMUBetsLite)
|
119
|
+
datetime_value = (Time.now - 365).xmlschema
|
120
|
+
|
121
|
+
operation.body = {
|
122
|
+
getMUBetsLite: {
|
123
|
+
request: {
|
124
|
+
header: {
|
125
|
+
clientStamp: 'test',
|
126
|
+
sessionToken: 'token'
|
127
|
+
},
|
128
|
+
betStatus: 'U',
|
129
|
+
marketId: 1,
|
130
|
+
betIds: {
|
131
|
+
betId: [1, 2, 3]
|
132
|
+
},
|
133
|
+
orderBy: 'NONE',
|
134
|
+
sortOrder: 'DESC',
|
135
|
+
recordCount: 10,
|
136
|
+
startRecord: 1,
|
137
|
+
matchedSince: datetime_value,
|
138
|
+
excludeLastSecond: true
|
139
|
+
}
|
140
|
+
}
|
141
|
+
}
|
142
|
+
|
143
|
+
expected = Nokogiri.XML(%{
|
144
|
+
<env:Envelope
|
145
|
+
xmlns:lol0="http://www.betfair.com/publicapi/v5/BFExchangeService/"
|
146
|
+
xmlns:lol1="http://www.betfair.com/publicapi/types/exchange/v5/"
|
147
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
|
148
|
+
<env:Header/>
|
149
|
+
<env:Body>
|
150
|
+
<lol0:getMUBetsLite>
|
151
|
+
<lol0:request>
|
152
|
+
<header>
|
153
|
+
<clientStamp>test</clientStamp>
|
154
|
+
<sessionToken>token</sessionToken>
|
155
|
+
</header>
|
156
|
+
<betStatus>U</betStatus>
|
157
|
+
<marketId>1</marketId>
|
158
|
+
<betIds>
|
159
|
+
<lol1:betId>1</lol1:betId>
|
160
|
+
<lol1:betId>2</lol1:betId>
|
161
|
+
<lol1:betId>3</lol1:betId>
|
162
|
+
</betIds>
|
163
|
+
<orderBy>NONE</orderBy>
|
164
|
+
<sortOrder>DESC</sortOrder>
|
165
|
+
<recordCount>10</recordCount>
|
166
|
+
<startRecord>1</startRecord>
|
167
|
+
<matchedSince>#{datetime_value}</matchedSince>
|
168
|
+
<excludeLastSecond>true</excludeLastSecond>
|
169
|
+
</lol0:request>
|
170
|
+
</lol0:getMUBetsLite>
|
171
|
+
</env:Body>
|
172
|
+
</env:Envelope>
|
173
|
+
})
|
174
|
+
|
175
|
+
expect(Nokogiri.XML operation.build).
|
176
|
+
to be_equivalent_to(expected).respecting_element_order
|
177
|
+
end
|
178
|
+
|
179
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Integration with BLZService' do
|
4
|
+
|
5
|
+
subject(:client) { Sekken.new fixture('wsdl/blz_service') }
|
6
|
+
|
7
|
+
let(:service_name) { :BLZService }
|
8
|
+
let(:port_name) { :BLZServiceSOAP11port_http }
|
9
|
+
|
10
|
+
it 'creates an example request' do
|
11
|
+
operation = client.operation(service_name, port_name, :getBank)
|
12
|
+
|
13
|
+
expect(operation.example_body).to eq(
|
14
|
+
getBank: {
|
15
|
+
blz: 'string'
|
16
|
+
}
|
17
|
+
)
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'builds a request' do
|
21
|
+
operation = client.operation(service_name, port_name, :getBank)
|
22
|
+
|
23
|
+
operation.body = {
|
24
|
+
getBank: {
|
25
|
+
blz: 70070010
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
expected = Nokogiri.XML(%{
|
30
|
+
<env:Envelope
|
31
|
+
xmlns:lol0="http://thomas-bayer.com/blz/"
|
32
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
|
33
|
+
<env:Header/>
|
34
|
+
<env:Body>
|
35
|
+
<lol0:getBank>
|
36
|
+
<lol0:blz>70070010</lol0:blz>
|
37
|
+
</lol0:getBank>
|
38
|
+
</env:Body>
|
39
|
+
</env:Envelope>
|
40
|
+
})
|
41
|
+
|
42
|
+
expect(Nokogiri.XML operation.build).
|
43
|
+
to be_equivalent_to(expected).respecting_element_order
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Integration with Bookt' do
|
4
|
+
|
5
|
+
subject(:client) { Sekken.new(wsdl_url, http_mock) }
|
6
|
+
|
7
|
+
let(:wsdl_url) { 'http://connect.bookt.com/svc/connect.svc?wsdl' }
|
8
|
+
let(:wsdl2_url) { 'http://connect.bookt.com/svc/connect.svc?wsdl=wsdl1' }
|
9
|
+
let(:wsdl3_url) { 'http://connect.bookt.com/svc/connect.svc?wsdl=wsdl0' }
|
10
|
+
|
11
|
+
before do
|
12
|
+
http_mock.fake_request(wsdl_url, 'wsdl/bookt/bookt.wsdl')
|
13
|
+
http_mock.fake_request(wsdl2_url, 'wsdl/bookt/bookt2.wsdl')
|
14
|
+
http_mock.fake_request(wsdl3_url, 'wsdl/bookt/bookt3.wsdl')
|
15
|
+
|
16
|
+
# 16 schemas to import
|
17
|
+
schema_import_base = 'http://connect.bookt.com/svc/connect.svc?xsd=xsd%d'
|
18
|
+
(0..15).each do |i|
|
19
|
+
url = schema_import_base % i
|
20
|
+
http_mock.fake_request(url, "wsdl/bookt/bookt#{i}.xsd")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'returns a map of services and ports' do
|
25
|
+
expect(client.services).to eq(
|
26
|
+
'Connect' => {
|
27
|
+
:ports => {
|
28
|
+
'IConnect' => {
|
29
|
+
:type => 'http://schemas.xmlsoap.org/wsdl/soap/',
|
30
|
+
:location => 'http://connect.bookt.com/svc/connect.svc'
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'resolves WSDL imports to get the operations' do
|
38
|
+
operations = client.operations('Connect', 'IConnect')
|
39
|
+
|
40
|
+
expect(operations).to be_an(Array)
|
41
|
+
expect(operations.count).to eq(26)
|
42
|
+
|
43
|
+
expect(operations).to include('GetBooking')
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'resolves XML Schema imports to get all elements' do
|
47
|
+
get_booking = client.operation('Connect', 'IConnect', 'GetBooking')
|
48
|
+
|
49
|
+
namespace = 'https://connect.bookt.com/connect'
|
50
|
+
|
51
|
+
expect(get_booking.body_parts).to eq([
|
52
|
+
[['GetBooking'], { namespace: namespace, form: 'qualified', singular: true }],
|
53
|
+
[['GetBooking', 'apiKey'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
54
|
+
[['GetBooking', 'bookingID'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:string' }],
|
55
|
+
[['GetBooking', 'useInternalID'], { namespace: namespace, form: 'qualified', singular: true, type: 'xs:boolean' }]
|
56
|
+
])
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|