Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6053119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:00:15+00:00 2026-05-23T08:00:15+00:00

I am trying to connect to the following betfair.com web service. https://api.betfair.com/global/v3/BFGlobalService.wsdl Basically, I

  • 0

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();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:00:16+00:00Added an answer on May 23, 2026 at 8:00 am

    You’re never calling your Login method. Try this:

    static void Main(string[] args)
    {
        m_globalService = new BFGlobalService();
    
        Login(); // calling your login method here...
    }
    

    Also: I’m not familiar with that API but I bet you’re missing an initialization call between creating the BFGlobalService object and calling its Login method.

    Here are a few pointers to get going with C#:

    • Make use of properties rather than public variables
    • Use try/catch exception handling on your web service calls
    • Try to not do too much work in your Main function. (I know you’re just getting started but it’s good to practice doing things the right way.) You should have a separate class that Main instantiates and invokes to initiate your web service interaction.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When trying to connect to a web service using the following $client = new
I'm getting the following error when trying to connect to a WCF web service:
I'm trying to connect and use a web service method. I'm getting the following
I am trying to connect to a web service that uses a secure connection.
I am trying to connect to my gmail account using com.sun.mail ..... Mail api.
I'm trying to connect to the server https://www.xpiron.com/schedule in a ruby script. However, when
I'm trying to connect to google documents (following Marco Cantu's excellent REST example) but
i get this following error when i am trying to connect my localhost mysql
I am trying to connect to FBJS bridge. It keeps giving me the following
I trying to connect to a Java Service with some special security requirements It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.