Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 30th, 2007, 05:21 AM
Friend of Wrox
 
Join Date: May 2006
Location: Northampton, United Kingdom.
Posts: 107
Thanks: 1
Thanked 8 Times in 7 Posts
Default SOAP and Betfair API


Can you help please?


I am learning to use SOAP and I have been starting out by trying to access the Betfair API.


So far I have managed to log in successfully but I am now stuck


I have seen a sample program on the betfair site but it's written in C# (See below)


Has anyone converted this code to VB if so can you post some of the code?
For instance how do I go about calling GetEventsReq and display the information on a datagrid?


I'm sure that once I can understand how to run one option I can relate the lessons learnt to all other options.


I'd be very grateful for any assistance.



Thanks




/////////////////////////////////////////////////////////////////////////////////
// Load Today's Card (horses)
GetEventsReq eventsReq = new GetEventsReq();
eventsReq.header = new APIRequestHeader();
eventsReq.header.sessionToken = sessionToken;
eventsReq.eventParentId = 13;
GetEventsResp eventsResp = service.getEvents(eventsReq);
sessionToken = eventsResp.header.sessionToken;
/////////////////////////////////////////////////////////////////////////////////
// Display total number of markets, and select one randomly to load
int numberOfMarkets = eventsResp.marketItems.Length;
Console.WriteLine("{0} markets in Today's Card", numberOfMarkets);
Random rand = new Random();
MarketSummary marketSummary = eventsResp.marketItems[rand.Next(numberOfMarkets)];
/////////////////////////////////////////////////////////////////////////////////
// Get market
GetMarketReq marketReq = new GetMarketReq();
marketReq.header = new APIRequestHeader();
marketReq.header.sessionToken = sessionToken;
marketReq.marketId = marketSummary.marketId;
GetMarketResp marketResp = service.getMarket(marketReq);
sessionToken = marketReq.header.sessionToken;
/////////////////////////////////////////////////////////////////////////////////
// Get market prices
GetMarketPricesReq marketPricesReq = new GetMarketPricesReq();
marketPricesReq.header = new APIRequestHeader();
marketPricesReq.header.sessionToken = sessionToken;
marketPricesReq.marketId = marketSummary.marketId;
GetMarketPricesResp marketPricesResp = service.getMarketPrices(marketPricesReq);
sessionToken = marketPricesResp.header.sessionToken;
/////////////////////////////////////////////////////////////////////////////////
// Display market
Console.WriteLine("{0:HH:mm} {1}", marketResp.market.marketDisplayTime, marketResp.market.name);
if (marketResp.market.runners == null || marketPricesResp.marketPrices.runnerPrices == null)
{
Console.WriteLine(marketResp.market.marketStatus.T oString());
}
else
{
for (int i = 0; i < marketResp.market.runners.Length; i++)
{
Console.WriteLine("{0} {1}", marketResp.market.runners[i].name.PadRight(30),
marketPricesResp.marketPrices.runnerPrices[i].bestPricesToBack[0].price);
}

__________________
Try our latest project www.nobanx.com Currency Exchange for members
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is SOAP why do we need it nidhimittal Pro PHP 1 October 23rd, 2006 03:28 AM
soap on C shiji4u XML 0 March 1st, 2006 04:59 AM
Using SOAP and C++ RussellThor Visual C++ 0 November 29th, 2005 09:06 PM
API SOAP request harpua PHP How-To 0 September 13th, 2005 10:21 AM
soap a.slaughter Pro PHP 0 March 22nd, 2005 10:25 AM



All times are GMT -4. The time now is 05:35 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.