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,82 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Integration with EmailVerification service' do
|
4
|
+
|
5
|
+
subject(:client) { Sekken.new fixture('wsdl/email_verification') }
|
6
|
+
|
7
|
+
let(:service_name) { :EmailVerNoTestEmail }
|
8
|
+
let(:port_name) { :EmailVerNoTestEmailSoap12 }
|
9
|
+
|
10
|
+
it 'returns a map of services and ports' do
|
11
|
+
expect(client.services).to eq(
|
12
|
+
'EmailVerNoTestEmail' => {
|
13
|
+
:ports => {
|
14
|
+
'EmailVerNoTestEmailSoap' => {
|
15
|
+
:type => 'http://schemas.xmlsoap.org/wsdl/soap/',
|
16
|
+
:location => 'http://ws.cdyne.com/emailverify/Emailvernotestemail.asmx'
|
17
|
+
},
|
18
|
+
'EmailVerNoTestEmailSoap12' => {
|
19
|
+
:type => 'http://schemas.xmlsoap.org/wsdl/soap12/',
|
20
|
+
:location => 'http://ws.cdyne.com/emailverify/Emailvernotestemail.asmx'
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'knows the operations' do
|
28
|
+
service, port = 'EmailVerNoTestEmail', 'EmailVerNoTestEmailSoap12'
|
29
|
+
operation = client.operation(service, port, 'VerifyEmail')
|
30
|
+
|
31
|
+
expect(operation.soap_action).to eq('http://ws.cdyne.com/VerifyEmail')
|
32
|
+
expect(operation.endpoint).to eq('http://ws.cdyne.com/emailverify/Emailvernotestemail.asmx')
|
33
|
+
|
34
|
+
namespace = 'http://ws.cdyne.com/'
|
35
|
+
|
36
|
+
expect(operation.body_parts).to eq([
|
37
|
+
[['VerifyEmail'], { namespace: namespace, form: 'qualified', singular: true }],
|
38
|
+
[['VerifyEmail', 'email'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
39
|
+
[['VerifyEmail', 'LicenseKey'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }]
|
40
|
+
])
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'creates an example request' do
|
44
|
+
operation = client.operation(service_name, port_name, :VerifyEmail)
|
45
|
+
|
46
|
+
expect(operation.example_body).to eq(
|
47
|
+
VerifyEmail: {
|
48
|
+
email: 'string',
|
49
|
+
LicenseKey: 'string'
|
50
|
+
}
|
51
|
+
)
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'builds a request' do
|
55
|
+
operation = client.operation(service_name, port_name, :VerifyEmail)
|
56
|
+
|
57
|
+
operation.body = {
|
58
|
+
VerifyEmail: {
|
59
|
+
email: 'soap@example.com',
|
60
|
+
LicenseKey: '?'
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
expected = Nokogiri.XML(%{
|
65
|
+
<env:Envelope
|
66
|
+
xmlns:lol0="http://ws.cdyne.com/"
|
67
|
+
xmlns:env="http://www.w3.org/2003/05/soap-envelope">
|
68
|
+
<env:Header/>
|
69
|
+
<env:Body>
|
70
|
+
<lol0:VerifyEmail>
|
71
|
+
<lol0:email>soap@example.com</lol0:email>
|
72
|
+
<lol0:LicenseKey>?</lol0:LicenseKey>
|
73
|
+
</lol0:VerifyEmail>
|
74
|
+
</env:Body>
|
75
|
+
</env:Envelope>
|
76
|
+
})
|
77
|
+
|
78
|
+
expect(Nokogiri.XML operation.build).
|
79
|
+
to be_equivalent_to(expected).respecting_element_order
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
@@ -0,0 +1,216 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Integration with Equifax' do
|
4
|
+
|
5
|
+
subject(:client) { Sekken.new fixture('wsdl/equifax') }
|
6
|
+
|
7
|
+
let(:service_name) { :canadav2 }
|
8
|
+
let(:port_name) { :canadaHttpPortV2 }
|
9
|
+
|
10
|
+
it 'returns a map of services and ports' do
|
11
|
+
expect(client.services).to eq(
|
12
|
+
'canadav2' => {
|
13
|
+
ports: {
|
14
|
+
'canadaHttpPortV2' => {
|
15
|
+
type: 'http://schemas.xmlsoap.org/wsdl/soap/',
|
16
|
+
location: 'https://pilot.eidverifier.com/uru/soap/cert/canadav2'
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'knows operations with attributes and attribute groups' do
|
24
|
+
operation = client.operation(service_name, port_name, 'startTransaction')
|
25
|
+
|
26
|
+
expect(operation.soap_action).to eq('')
|
27
|
+
expect(operation.endpoint).to eq('https://pilot.eidverifier.com/uru/soap/cert/canadav2')
|
28
|
+
|
29
|
+
ns1 = 'http://eid.equifax.com/soap/schema/canada/v2'
|
30
|
+
|
31
|
+
expect(operation.body_parts).to eq([
|
32
|
+
[['InitialRequest'], { namespace: ns1, form: 'qualified', singular: true }],
|
33
|
+
[['InitialRequest', 'Identity'], { namespace: ns1, form: 'qualified', singular: true }],
|
34
|
+
[['InitialRequest', 'Identity', 'Name'], { namespace: ns1, form: 'qualified', singular: true }],
|
35
|
+
[['InitialRequest', 'Identity', 'Name', 'FirstName'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
36
|
+
[['InitialRequest', 'Identity', 'Name', 'MiddleName'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
37
|
+
[['InitialRequest', 'Identity', 'Name', 'MiddleInitial'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
38
|
+
[['InitialRequest', 'Identity', 'Name', 'LastName'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
39
|
+
[['InitialRequest', 'Identity', 'Name', 'Suffix'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
40
|
+
|
41
|
+
[['InitialRequest', 'Identity', 'Address'], { namespace: ns1, form: 'qualified', singular: false,
|
42
|
+
attributes: {
|
43
|
+
'timeAtAddress' => { optional: true },
|
44
|
+
'addressType' => { optional: false }
|
45
|
+
}
|
46
|
+
}],
|
47
|
+
|
48
|
+
[['InitialRequest', 'Identity', 'Address', 'FreeFormAddress'], { namespace: ns1, form: 'qualified', singular: true }],
|
49
|
+
[['InitialRequest', 'Identity', 'Address', 'FreeFormAddress', 'AddressLine'], { namespace: ns1, form: 'qualified', singular: false, type: 'string' }],
|
50
|
+
[['InitialRequest', 'Identity', 'Address', 'HybridAddress'], { namespace: ns1, form: 'qualified', singular: true }],
|
51
|
+
[['InitialRequest', 'Identity', 'Address', 'HybridAddress', 'AddressLine'], { namespace: ns1, form: 'qualified', singular: false, type: 'string' }],
|
52
|
+
[['InitialRequest', 'Identity', 'Address', 'HybridAddress', 'City'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
53
|
+
[['InitialRequest', 'Identity', 'Address', 'HybridAddress', 'Province'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
54
|
+
[['InitialRequest', 'Identity', 'Address', 'HybridAddress', 'PostalCode'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
55
|
+
[['InitialRequest', 'Identity', 'SIN'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
56
|
+
[['InitialRequest', 'Identity', 'DateOfBirth'], { namespace: ns1, form: 'qualified', singular: true }],
|
57
|
+
[['InitialRequest', 'Identity', 'DateOfBirth', 'Day'], { namespace: ns1, form: 'qualified', singular: true, type: 'positiveInteger' }],
|
58
|
+
[['InitialRequest', 'Identity', 'DateOfBirth', 'Month'], { namespace: ns1, form: 'qualified', singular: true, type: 'positiveInteger' }],
|
59
|
+
[['InitialRequest', 'Identity', 'DateOfBirth', 'Year'], { namespace: ns1, form: 'qualified', singular: true, type: 'positiveInteger' }],
|
60
|
+
|
61
|
+
[['InitialRequest', 'Identity', 'DriversLicense'], { namespace: ns1, form: 'qualified', singular: true,
|
62
|
+
attributes: {
|
63
|
+
'driversLicenseAddressType'=> { optional: true }
|
64
|
+
}
|
65
|
+
}],
|
66
|
+
|
67
|
+
[['InitialRequest', 'Identity', 'DriversLicense', 'Number'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
68
|
+
[['InitialRequest', 'Identity', 'DriversLicense', 'Province'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
69
|
+
|
70
|
+
[['InitialRequest', 'Identity', 'PhoneNumber'], { namespace: ns1, form: 'qualified', singular: false,
|
71
|
+
attributes: {
|
72
|
+
'phoneType' => { optional: true }
|
73
|
+
}
|
74
|
+
}],
|
75
|
+
|
76
|
+
[['InitialRequest', 'Identity', 'PhoneNumber', 'AreaCode'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
77
|
+
[['InitialRequest', 'Identity', 'PhoneNumber', 'Exchange'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
78
|
+
[['InitialRequest', 'Identity', 'PhoneNumber', 'Number'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
79
|
+
[['InitialRequest', 'Identity', 'PhoneNumber', 'PhoneNumber'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
80
|
+
[['InitialRequest', 'Identity', 'Email'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
81
|
+
[['InitialRequest', 'Identity', 'IPAddress'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
82
|
+
[['InitialRequest', 'Identity', 'CreditCardNumber'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
83
|
+
[['InitialRequest', 'Identity', 'CustomerId'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
84
|
+
[['InitialRequest', 'ProcessingOptions'], { namespace: ns1, form: 'qualified', singular: true }],
|
85
|
+
[['InitialRequest', 'ProcessingOptions', 'Language'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }],
|
86
|
+
[['InitialRequest', 'ProcessingOptions', 'EnvironmentOverride'], { namespace: ns1, form: 'qualified', singular: true, type: 'string' }]
|
87
|
+
])
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'creates an example body with attributes' do
|
91
|
+
operation = client.operation(service_name, port_name, :startTransaction)
|
92
|
+
|
93
|
+
expect(operation.example_body).to eq(
|
94
|
+
InitialRequest: {
|
95
|
+
Identity: {
|
96
|
+
Name: {
|
97
|
+
FirstName: 'string',
|
98
|
+
MiddleName: 'string',
|
99
|
+
MiddleInitial: 'string',
|
100
|
+
LastName: 'string',
|
101
|
+
Suffix: 'string'
|
102
|
+
},
|
103
|
+
Address: [
|
104
|
+
{
|
105
|
+
FreeFormAddress: {
|
106
|
+
AddressLine: ['string']
|
107
|
+
},
|
108
|
+
HybridAddress: {
|
109
|
+
AddressLine: ['string'],
|
110
|
+
City: 'string',
|
111
|
+
Province: 'string',
|
112
|
+
PostalCode: 'string'
|
113
|
+
},
|
114
|
+
|
115
|
+
# attributes are prefixed with an underscore.
|
116
|
+
_timeAtAddress: 'nonNegativeInteger',
|
117
|
+
_addressType: 'string'
|
118
|
+
}
|
119
|
+
],
|
120
|
+
SIN: 'string',
|
121
|
+
DateOfBirth: {
|
122
|
+
Day: 'positiveInteger',
|
123
|
+
Month: 'positiveInteger',
|
124
|
+
Year: 'positiveInteger'
|
125
|
+
},
|
126
|
+
DriversLicense: {
|
127
|
+
Number: 'string',
|
128
|
+
Province: 'string',
|
129
|
+
|
130
|
+
# another attribute
|
131
|
+
_driversLicenseAddressType: 'string'
|
132
|
+
},
|
133
|
+
PhoneNumber: [
|
134
|
+
{
|
135
|
+
AreaCode: 'string',
|
136
|
+
Exchange: 'string',
|
137
|
+
Number: 'string',
|
138
|
+
PhoneNumber: 'string',
|
139
|
+
|
140
|
+
# another attribute
|
141
|
+
_phoneType: 'string'
|
142
|
+
}
|
143
|
+
],
|
144
|
+
Email: 'string',
|
145
|
+
IPAddress: 'string',
|
146
|
+
CreditCardNumber: 'string',
|
147
|
+
CustomerId: 'string'
|
148
|
+
},
|
149
|
+
ProcessingOptions: {
|
150
|
+
Language: 'string',
|
151
|
+
EnvironmentOverride: 'string'
|
152
|
+
}
|
153
|
+
}
|
154
|
+
)
|
155
|
+
end
|
156
|
+
|
157
|
+
it 'creates a request with attributes' do
|
158
|
+
operation = client.operation(service_name, port_name, :startTransaction)
|
159
|
+
|
160
|
+
operation.body = {
|
161
|
+
InitialRequest: {
|
162
|
+
Identity: {
|
163
|
+
Address: [
|
164
|
+
{
|
165
|
+
FreeFormAddress: {
|
166
|
+
AddressLine: ['The original', 'Abbey Road, London']
|
167
|
+
},
|
168
|
+
HybridAddress: {
|
169
|
+
AddressLine: ['The original', 'Abbey Road'],
|
170
|
+
City: 'London',
|
171
|
+
Province: 'Camden',
|
172
|
+
PostalCode: 'NW8 9BS'
|
173
|
+
},
|
174
|
+
|
175
|
+
# attributes are prefixed with an underscore
|
176
|
+
_timeAtAddress: 3,
|
177
|
+
_addressType: 'public'
|
178
|
+
}
|
179
|
+
]
|
180
|
+
}
|
181
|
+
}
|
182
|
+
}
|
183
|
+
|
184
|
+
expected = Nokogiri.XML('
|
185
|
+
<env:Envelope
|
186
|
+
xmlns:lol0="http://eid.equifax.com/soap/schema/canada/v2"
|
187
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
|
188
|
+
<env:Header>
|
189
|
+
</env:Header>
|
190
|
+
<env:Body>
|
191
|
+
<lol0:InitialRequest>
|
192
|
+
<lol0:Identity>
|
193
|
+
<lol0:Address timeAtAddress="3" addressType="public">
|
194
|
+
<lol0:FreeFormAddress>
|
195
|
+
<lol0:AddressLine>The original</lol0:AddressLine>
|
196
|
+
<lol0:AddressLine>Abbey Road, London</lol0:AddressLine>
|
197
|
+
</lol0:FreeFormAddress>
|
198
|
+
<lol0:HybridAddress>
|
199
|
+
<lol0:AddressLine>The original</lol0:AddressLine>
|
200
|
+
<lol0:AddressLine>Abbey Road</lol0:AddressLine>
|
201
|
+
<lol0:City>London</lol0:City>
|
202
|
+
<lol0:Province>Camden</lol0:Province>
|
203
|
+
<lol0:PostalCode>NW8 9BS</lol0:PostalCode>
|
204
|
+
</lol0:HybridAddress>
|
205
|
+
</lol0:Address>
|
206
|
+
</lol0:Identity>
|
207
|
+
</lol0:InitialRequest>
|
208
|
+
</env:Body>
|
209
|
+
</env:Envelope>
|
210
|
+
')
|
211
|
+
|
212
|
+
expect(Nokogiri.XML operation.build).
|
213
|
+
to be_equivalent_to(expected).respecting_element_order
|
214
|
+
end
|
215
|
+
|
216
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Integration with Geotrust' do
|
4
|
+
|
5
|
+
subject(:client) { Sekken.new fixture('wsdl/geotrust') }
|
6
|
+
|
7
|
+
it 'knows the operations' do
|
8
|
+
pending "this fixture is missing a message element! " \
|
9
|
+
"find out if we need to handle this case or if the fixture is incomplete." do
|
10
|
+
|
11
|
+
operation = client.operation('GetQuickApproverList')
|
12
|
+
expect(operation.name).to eq('THIS-TEST-FAILS')
|
13
|
+
expect(operation.endpoint).to eq('https://test-api.geotrust.com:443/webtrust/query.jws')
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,156 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Integration with Interhome' do
|
4
|
+
|
5
|
+
subject(:client) { Sekken.new fixture('wsdl/interhome') }
|
6
|
+
|
7
|
+
let(:service_name) { :WebService }
|
8
|
+
let(:port_name) { :WebServiceSoap }
|
9
|
+
|
10
|
+
it 'returns a map of services and ports' do
|
11
|
+
expect(client.services).to eq(
|
12
|
+
'WebService' => {
|
13
|
+
:ports => {
|
14
|
+
'WebServiceSoap' => {
|
15
|
+
:type => 'http://schemas.xmlsoap.org/wsdl/soap/',
|
16
|
+
:location => 'https://webservices.interhome.com/quality/partnerV3/WebService.asmx'
|
17
|
+
},
|
18
|
+
'WebServiceSoap12' => {
|
19
|
+
:type => 'http://schemas.xmlsoap.org/wsdl/soap12/',
|
20
|
+
:location => 'https://webservices.interhome.com/quality/partnerV3/WebService.asmx'
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'knows the operations' do
|
28
|
+
operation = client.operation(service_name, port_name, 'ClientBooking')
|
29
|
+
|
30
|
+
expect(operation.soap_action).to eq('http://www.interhome.com/webservice/ClientBooking')
|
31
|
+
expect(operation.endpoint).to eq('https://webservices.interhome.com/quality/partnerV3/WebService.asmx')
|
32
|
+
|
33
|
+
namespace = 'http://www.interhome.com/webservice'
|
34
|
+
|
35
|
+
expect(operation.body_parts).to eq([
|
36
|
+
[['ClientBooking'], { namespace: namespace, form: 'qualified', singular: true }],
|
37
|
+
[['ClientBooking', 'inputValue'], { namespace: namespace, form: 'qualified', singular: true }],
|
38
|
+
[['ClientBooking', 'inputValue', 'SalesOfficeCode'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
39
|
+
[['ClientBooking', 'inputValue', 'AccommodationCode'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
40
|
+
|
41
|
+
[['ClientBooking', 'inputValue', 'AdditionalServices'],
|
42
|
+
{namespace: namespace, form: 'qualified', singular: true }],
|
43
|
+
[['ClientBooking', 'inputValue', 'AdditionalServices', 'AdditionalServiceInputItem'],
|
44
|
+
{namespace: namespace, form: 'qualified', singular: false }],
|
45
|
+
[['ClientBooking', 'inputValue', 'AdditionalServices', 'AdditionalServiceInputItem', 'Code'],
|
46
|
+
{namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
47
|
+
[['ClientBooking', 'inputValue', 'AdditionalServices', 'AdditionalServiceInputItem', 'Count'],
|
48
|
+
{namespace: namespace, form: 'qualified', singular: true, type: 's:int' }],
|
49
|
+
|
50
|
+
[['ClientBooking', 'inputValue', 'CustomerSalutationType'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
51
|
+
[['ClientBooking', 'inputValue', 'CustomerName'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
52
|
+
[['ClientBooking', 'inputValue', 'CustomerFirstName'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
53
|
+
[['ClientBooking', 'inputValue', 'CustomerPhone'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
54
|
+
[['ClientBooking', 'inputValue', 'CustomerFax'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
55
|
+
[['ClientBooking', 'inputValue', 'CustomerEmail'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
56
|
+
[['ClientBooking', 'inputValue', 'CustomerAddressStreet'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
57
|
+
[['ClientBooking', 'inputValue', 'CustomerAddressAdditionalStreet'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
58
|
+
[['ClientBooking', 'inputValue', 'CustomerAddressZIP'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
59
|
+
[['ClientBooking', 'inputValue', 'CustomerAddressPlace'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
60
|
+
[['ClientBooking', 'inputValue', 'CustomerAddressState'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
61
|
+
[['ClientBooking', 'inputValue', 'CustomerAddressCountryCode'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
62
|
+
[['ClientBooking', 'inputValue', 'Comment'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
63
|
+
[['ClientBooking', 'inputValue', 'Adults'], { namespace: namespace, form: 'qualified', singular: true, type: 's:int' }],
|
64
|
+
[['ClientBooking', 'inputValue', 'Babies'], { namespace: namespace, form: 'qualified', singular: true, type: 's:int' }],
|
65
|
+
[['ClientBooking', 'inputValue', 'Children'], { namespace: namespace, form: 'qualified', singular: true, type: 's:int' }],
|
66
|
+
[['ClientBooking', 'inputValue', 'CheckIn'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
67
|
+
[['ClientBooking', 'inputValue', 'CheckOut'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
68
|
+
[['ClientBooking', 'inputValue', 'LanguageCode'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
69
|
+
[['ClientBooking', 'inputValue', 'CurrencyCode'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
70
|
+
[['ClientBooking', 'inputValue', 'RetailerCode'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
71
|
+
[['ClientBooking', 'inputValue', 'RetailerExtraCode'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
72
|
+
[['ClientBooking', 'inputValue', 'PaymentType'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
73
|
+
[['ClientBooking', 'inputValue', 'CreditCardType'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
74
|
+
[['ClientBooking', 'inputValue', 'CreditCardNumber'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
75
|
+
[['ClientBooking', 'inputValue', 'CreditCardCvc'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
76
|
+
[['ClientBooking', 'inputValue', 'CreditCardExpiry'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
77
|
+
[['ClientBooking', 'inputValue', 'CreditCardHolder'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
78
|
+
[['ClientBooking', 'inputValue', 'BankAccountNumber'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
79
|
+
[['ClientBooking', 'inputValue', 'BankCode'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }],
|
80
|
+
[['ClientBooking', 'inputValue', 'BankAccountHolder'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }]
|
81
|
+
])
|
82
|
+
end
|
83
|
+
|
84
|
+
# implicit headers. reference: http://www.ibm.com/developerworks/library/ws-tip-headers/index.html
|
85
|
+
it 'creates an example header' do
|
86
|
+
operation = client.operation(service_name, port_name, :Availability)
|
87
|
+
|
88
|
+
expect(operation.example_header).to eq(
|
89
|
+
ServiceAuthHeader: {
|
90
|
+
Username: 'string',
|
91
|
+
Password: 'string'
|
92
|
+
}
|
93
|
+
)
|
94
|
+
end
|
95
|
+
|
96
|
+
it 'creates an example body including optional elements' do
|
97
|
+
operation = client.operation(service_name, port_name, :Availability)
|
98
|
+
|
99
|
+
expect(operation.example_body).to eq(
|
100
|
+
Availability: {
|
101
|
+
|
102
|
+
# These are optional.
|
103
|
+
inputValue: {
|
104
|
+
AccommodationCode: 'string',
|
105
|
+
CheckIn: 'string',
|
106
|
+
CheckOut: 'string'
|
107
|
+
}
|
108
|
+
|
109
|
+
}
|
110
|
+
)
|
111
|
+
end
|
112
|
+
|
113
|
+
it 'skips optional elements in the request' do
|
114
|
+
operation = client.operation(service_name, port_name, :Availability)
|
115
|
+
|
116
|
+
operation.header = {
|
117
|
+
ServiceAuthHeader: {
|
118
|
+
Username: 'test',
|
119
|
+
Password: 'secret'
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
operation.body = {
|
124
|
+
Availability: {
|
125
|
+
inputValue: {
|
126
|
+
# Leaving out two optional elements on purpose.
|
127
|
+
AccommodationCode: 'secret'
|
128
|
+
}
|
129
|
+
}
|
130
|
+
}
|
131
|
+
|
132
|
+
expected = Nokogiri.XML('
|
133
|
+
<env:Envelope
|
134
|
+
xmlns:lol0="http://www.interhome.com/webservice"
|
135
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
|
136
|
+
<env:Header>
|
137
|
+
<lol0:ServiceAuthHeader>
|
138
|
+
<lol0:Username>test</lol0:Username>
|
139
|
+
<lol0:Password>secret</lol0:Password>
|
140
|
+
</lol0:ServiceAuthHeader>
|
141
|
+
</env:Header>
|
142
|
+
<env:Body>
|
143
|
+
<lol0:Availability>
|
144
|
+
<lol0:inputValue>
|
145
|
+
<lol0:AccommodationCode>secret</lol0:AccommodationCode>
|
146
|
+
</lol0:inputValue>
|
147
|
+
</lol0:Availability>
|
148
|
+
</env:Body>
|
149
|
+
</env:Envelope>
|
150
|
+
')
|
151
|
+
|
152
|
+
expect(Nokogiri.XML operation.build).
|
153
|
+
to be_equivalent_to(expected).respecting_element_order
|
154
|
+
end
|
155
|
+
|
156
|
+
end
|