Sunday, 4 October 2009

Inital Development


I work in Visual Studio 2008 – if you are currently registered at either a UK or US University (and possibly elsewhere in the world, I’m not sure), you can obtain a copy of this IDE for free (from Microsoft Dreamspark), along with a number of other Microsoft packages. It’s a nice thing that Microsoft are doing – have a look if you’ve not already heard of it.
To begin working with the Betfair API, start a new project (I’m using a Windows Forms Application), and add the WSDL links as Web References.

Don’t add them as Service References, as I did to start with – I then spent 6 hours writing the WSDL classes myself, before I realised my mistake (Visual Studio will generate these classes for you, that’s kind of the whole point of WSDL). So to add the links as Web References, goto Project->Add Web Reference, and enter the WSDL links before adding  the references to your project. The links can be found in the Betfair API Documentation – the versions I’m currently using are:
The Global Service contains methods that work across exchanges – such as logging in, account management, etc, while the Exchange Service contains specific methods for finding markets and placing bets, etc. There is also an Australian Exchange Service, that enables access to Betfair’s Australian betting services – this isn’t something I will be using in the near future.
The way I understand the WSDL links at present is this (please correct me if I’m wrong): They allow the .NET environment to treat the remote web services as if they were methods on the local machine. This means that we can develop with little knowledge of what is happening in the underlying SOAP and XML parsing protocols, which is a nice thing if you don’t know much about SOAP.
The next post will focus on logging in to your Betfair account using the API. How are you doing so far?

No comments:

Post a Comment