Technical Notes

Many users will be content to use the Excel Add-In to access the Ratings Intelligence Web Service.

 

For those of you who wish to access the data from within other applications here are a few brief notes and examples using VBA and C#.

 

You can also look at and use code from the Excel Add-In which is not protected.

 

WSDL

http://www.ratingsintelligence.net/compliance.php?wsdl

This file fully describes the web service and allows application toolkits to create references to it.

 

Functions

The main function provided by the Web Service is:

GetStocksCompliance(Stocks, LicenceKey)

Stocks is an array of string containing the tickers and LicenceKey is a string containing your LicenceKey.

GetStocksCompliance returns an array of structure StockCompliance:

Stock As String
Compliance As Long
FullName As String
DivPurRatio As Double

For simplicity, the function returns the FullName of the stock indicating that the ticker has been recognised.

If the ticker is not on our Web Service then the FullName is returned as ? NOT IN DATABASE .

Your code should check FullName and if it is ? NOT IN DATABASE  you will know the stock is not on our Web Service. You can then notify us and we can investigate.

Please note: The last row in the result-set is always duplicated and can be ignored.

VBA

 

The file called setup.exe supplied with the Add-In is the Microsoft Office Web Services Toolkit 2.0 . This file can also be downloaded from Microsoft via the hyperlink. If you have not already done so you will need to install this to use the Web Services Toolkit and the Excel Add-In.

 

In the VBA application, such as Excel or Access in the VBA editor and choose Tools, Web Service References. Give it the WSDL URL.

This will create some class modules that can be used using code similar to the code below.


 

VBA code snippet

 

 

Dim MyTickers, MyResults, MyKey

Dim MyWS As clsws_RICompliance

 

' Array of Tickers - Normally load this from file or database.

MyTickers = Array("III LN", "BAA LN", "AVZ LN", "BLT LN")

 

' Every call requires valid licence key -normally store in registry.

MyKey = "????????????????" 'Replace with key given to you.

 

' Create SOAP object

Set MyWS = New clsws_RICompliance

 

On Error GoTo ExampleError

'Calls Web Service and returns array

MyResults = MyWS.wsm_GetStocksCompliance(MyTickers, MyKey)

'

' Code that uses array of MyResults

'

Exit Sub

ExampleError:

MsgBox Err.Description

 

 

C#

A similar process in Visual Studio.

Adding a Web Reference       

 


 

C# code snippet

////////////////////////////////////////////////////////////

 

StockCompliance[] MyResults;

RICompliance  MyWS;

 

// Array of Tickers – Normally load this from file or database.

string[] MyTickers = {"III LN" , "BAA LN" ,"AVZ LN" ,"BLT LN" };

 

// Every call requires valid licence key –normally store in registry.

string MyKey = "????????????????" ; //Replace with key given to you.

 

// Create SOAP object

MyWS = new RICompliance ();

 

try

 {

 // Calls Web Service and returns array

 MyResults = MyWS.GetStocksCompliance(MyTickers, MyKey);

 //

 // Code that uses array of MyResults

 //

 }

 

catch (SoapException MySoapEx)

 {

 MessageBox .Show("SOAP Error: " + MySoapEx.Message);

 }

 

//////////////////////////////////////////////////////////

 

 

 

Other Languages

 

Web Services can be consumed using most languages.