From ce3beb8161659d0832f99e43fb38039dd7d67867 Mon Sep 17 00:00:00 2001 From: rubiii Date: Wed, 5 Jun 2013 15:49:04 +0200 Subject: [PATCH] added a spec for the xignite service --- spec/fixtures/wsdl/xignite.wsdl | 3470 ++++++++++++++++++++++++++++++ spec/integration/xignite_spec.rb | 112 + 2 files changed, 3582 insertions(+) create mode 100644 spec/fixtures/wsdl/xignite.wsdl create mode 100644 spec/integration/xignite_spec.rb diff --git a/spec/fixtures/wsdl/xignite.wsdl b/spec/fixtures/wsdl/xignite.wsdl new file mode 100644 index 00000000..49302320 --- /dev/null +++ b/spec/fixtures/wsdl/xignite.wsdl @@ -0,0 +1,3470 @@ + + + This web service provides multiple security-related operations including mapping of symbol, CUSIP, CIK and name, the collection of statistical information to be used in stock growth simulations, split information, and lookup services. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get a list of securities. + + + + + Get a list of securities. + + + + + Get a list of instruments. + + + + + Get a list of instruments. + + + + + Get a list of issuers. + + + + + Get a list of issuers + + + + + Get a issuer by the company identifier. + + + + + Get master records by identifier. + + + + + Get master records by identifiers. + + + + + Get master records by exchange. + + + + + Get a master record by exchange and the last modified since date + + + + + Get a master record by sector. + + + + + Get a master record by industry. + + + + + Get the possible exchanges. + + + + + Get the possible industries. + + + + + Get the possible sectors. + + + + + Get the legacy exchanges. + + + + + Get the legacy exchange suffix. + + + + + Returns all the Indetifiers and names for securities listed on an exchange. + + + + + Get statistical information about exchanges. + + + + + + + Get a list of securities. + + + + + Get a list of securities. + + + + + Get a list of instruments. + + + + + Get a list of instruments. + + + + + Get a list of issuers. + + + + + Get a list of issuers + + + + + Get a issuer by the company identifier. + + + + + Get master records by identifier. + + + + + Get master records by identifiers. + + + + + Get master records by exchange. + + + + + Get a master record by exchange and the last modified since date + + + + + Get a master record by sector. + + + + + Get a master record by industry. + + + + + Get the possible exchanges. + + + + + Get the possible industries. + + + + + Get the possible sectors. + + + + + Get the legacy exchanges. + + + + + Get the legacy exchange suffix. + + + + + Returns all the Indetifiers and names for securities listed on an exchange. + + + + + Get statistical information about exchanges. + + + + + + + Get a list of securities. + + + + + Get a list of securities. + + + + + Get a list of instruments. + + + + + Get a list of instruments. + + + + + Get a list of issuers. + + + + + Get a list of issuers + + + + + Get a issuer by the company identifier. + + + + + Get master records by identifier. + + + + + Get master records by identifiers. + + + + + Get master records by exchange. + + + + + Get a master record by exchange and the last modified since date + + + + + Get a master record by sector. + + + + + Get a master record by industry. + + + + + Get the possible exchanges. + + + + + Get the possible industries. + + + + + Get the possible sectors. + + + + + Get the legacy exchanges. + + + + + Get the legacy exchange suffix. + + + + + Returns all the Indetifiers and names for securities listed on an exchange. + + + + + Get statistical information about exchanges. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This web service provides multiple security-related operations including mapping of symbol, CUSIP, CIK and name, the collection of statistical information to be used in stock growth simulations, split information, and lookup services. + + + + + + + + + + + + + + diff --git a/spec/integration/xignite_spec.rb b/spec/integration/xignite_spec.rb new file mode 100644 index 00000000..730245e7 --- /dev/null +++ b/spec/integration/xignite_spec.rb @@ -0,0 +1,112 @@ +require 'spec_helper' + +describe 'Integration with Xignite' do + + # reference: http://www.xignite.com/product/global-security-master-data/api/GetSecurities/ + subject(:client) { Savon.new fixture('wsdl/xignite') } + + let(:service_name) { :XigniteGlobalMaster } + let(:port_name) { :XigniteGlobalMasterSoap12 } + + it 'returns a map of services and ports' do + expect(client.services).to eq( + 'XigniteGlobalMaster' => { + ports: { + 'XigniteGlobalMasterSoap' => { + type: 'http://schemas.xmlsoap.org/wsdl/soap/', + location: 'http://globalmaster.xignite.com/xglobalmaster.asmx' + }, + 'XigniteGlobalMasterSoap12' => { + type: 'http://schemas.xmlsoap.org/wsdl/soap12/', + location: 'http://globalmaster.xignite.com/xglobalmaster.asmx' + } + } + } + ) + end + + it 'knows the operations' do + operation = client.operation(service_name, port_name, :GetSecurities) + + expect(operation.soap_action).to eq('http://www.xignite.com/services/GetSecurities') + expect(operation.endpoint).to eq('http://globalmaster.xignite.com/xglobalmaster.asmx') + + namespace = 'http://www.xignite.com/services/' + + expect(operation.body_parts).to eq([ + [['GetSecurities'], { namespace: namespace, form: 'qualified', singular: true }], + [['GetSecurities', 'Identifiers'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }], + [['GetSecurities', 'IdentifierType'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }], + [['GetSecurities', 'AsOfDate'], { namespace: namespace, form: 'qualified', singular: true, type: 's:string' }] + ]) + end + + it 'creates an example header' do + operation = client.operation(service_name, port_name, :GetSecurities) + + expect(operation.example_header).to eq( + Header: { + Username: 'string', + Password: 'string', + Tracer: 'string' + } + ) + end + + it 'creates an example body' do + operation = client.operation(service_name, port_name, :GetSecurities) + + expect(operation.example_body).to eq( + GetSecurities: { + Identifiers: 'string', + IdentifierType: 'string', + AsOfDate: 'string' + } + ) + end + + it 'creates a request with a header' do + operation = client.operation(service_name, port_name, :GetSecurities) + + operation.header = { + Header: { + Username: 'test', + Password: 'secret', + Tracer: 'i-dont-know' + } + } + + operation.body = { + GetSecurities: { + Identifiers: 'NESN.XVTX,BMW.XETR', + IdentifierType: 'Symbol', + AsOfDate: '6/4/2013' + } + } + + expected = Nokogiri.XML(' + + + + test + secret + i-dont-know + + + + + NESN.XVTX,BMW.XETR + Symbol + 6/4/2013 + + + + ') + + expect(Nokogiri.XML operation.build). + to be_equivalent_to(expected).respecting_element_order + end + +end