Question

I am trying to connect to the following betfair.com web service. https://api.betfair.com/global/v3/BFGlobalService.wsdl
Basically, I just want to log in and display this information in the console window.

I did this with PHP and it was so easy, but I am new to C# and am having trouble starting off.
Basically, I want to login and display the session token received from the web service on the screen.

I added the web service reference to the solution in visual studio .net 2010. In PHP we just had one request to make to the web service and it would return the data as an object. But it seems like in C#, I have to make 2 calls, Request and Response? Is this right?

Sorry, Im a newbie to c#, but I see great potential with the language, I really need some basic guidance as to how to proceed.

Currently, I have added the web service to my solution, What are the most basic things I have to do in order to login and receive a session token.

More Information about the Betfair Web Service can be found here:
http://bdp.betfair.com/index.php?option=com_weblinks&catid=59&Itemid=113

I tried looking through the example applications provided through betfair, but they are so complex, I just want the simplest way to Consume a webservice and login to retrieve a session token.

Thanks

EDIT
I was tryng something like this.

class Program
{
    public static string username = "username";
    public static string password = "password";
    public static int softwareId = 82;
    public static int productId = 0;


    private static BFGlobalService m_globalService;

    static void Main(string[] args)
    {
        m_globalService = new BFGlobalService();

    }

    static void Login()
    {
        LoginReq req = new LoginReq();
        req.username = username;
        req.password = password;
        req.productId = productId;
        req.vendorSoftwareId=softwareId;

        LoginResp resp = m_globalService.login(req);

        Console.WriteLine(resp.minorErrorCode);
        Console.ReadKey();
    }
}

But Im a noob so I dont even know if this is right!!

Any help to get me off my feet would be great!!, Plus a simple explanation if anything to complex.

Thanks!!

EDIT: Solution I had to replace these 4 lines at the end.

        string st = resp.errorCode.ToString();
        string sessTok = resp.header.sessionToken;

        Console.WriteLine(st + " " + sessTok);
        Console.ReadKey();

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top