Mumbles examples not working for me

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • wordy1
    Junior Member
    • Jul 2013
    • 3

    #1

    Mumbles examples not working for me

    I'm working through the 'Mumbles' examples and a big thank you to him for providing them.

    However, I can't get past the first Form example because of obvious errors created by VB Studio 2010.

    {1} Type BFGlobal.APIRequestHeader is not defined.

    Fairly obviously it needs to be. I can write plain VBA reasonable well but haven't graduated to the OOP.

    The free API code is available and works. I'm assuming somewhere I need a statement like this
    Private Const K_URL_ENDPOINT_SERVICE_GLOBAL_URL = "api.betfair.com/global/v3/BFGlobalService"

    It's a bit frustrating to have code that works but I don't understand enough to modify it OR code I understand which doesn't work

    I'll be grateful to anyone taking pity on a bit of a Newbie. The drawerful of certificates for Powerhouse, DCL and other presumably dead languages are no use whatever.
  • McTash
    Junior Member
    • Feb 2010
    • 14

    #2
    Hi there c# noob here

    So I'm guessing you have already added the service references as described in mumbles guide (or by this method: right click references -> add service reference -> add web reference) for both the global service and the exchange service.

    What are you naming these services? Or are you leaving them as default?

    Is your global service in fact named BFGlobal? (You can check the web references folder in the project structure to see).

    So in VB or C# we have the concept of namespaces. A namespace is used to stop class naming collisions. So as it happens both the global and exchange service define a class called APIRequestHeader. This is where the concept of namespaces comes in handy. We can inform the compiler which one we want to use by fully qualifying its namespace. So in your case the BFGlobal.APIRequestHeader

    One possibility for your error is that the BFGlobal namespace isn't actually called BFGlobal so the compiler can't find the class.


    You shouldn't need a statement like you describe as Visual Studio automagics up the relevant proxy gubbins when you add the service references.

    Check for naming error first, if that's no good we can have another look.

    Comment

    • wordy1
      Junior Member
      • Jul 2013
      • 3

      #3
      Thanks

      Thank you. I confess my newbieness to VB2000 and up is a handicap. I'll proceed as you suggest. It will be magical if I can get it running because I'm sure we all have our favourite brilliant ideas (!) Beware the brilliant idea

      Your help IS appreciated very much.

      Comment

      • wordy1
        Junior Member
        • Jul 2013
        • 3

        #4
        17 errors back to 2!

        IT WORKS!!!

        I did have the error below but somehow I've tracked down the problem. A HUGE thank you to McTash. So I've got connectivity and Login etc. without errors.

        Onward and upward.


        Well, I'm making progress. Web references working (DUH!) and no more whining about BFGlobal.

        Now I'm getting a namespace error for the form name

        Statement is not valid in a namespace vbform.vb
        Declaration expected testform.vb
        Last edited by wordy1; 23-07-2013, 01:32 PM.

        Comment

        • McTash
          Junior Member
          • Feb 2010
          • 14

          #5
          If I were you I'd work through the mumbles guide just to get something under your belt. Then I would look to learn C# instead and implement your betfair ideas with that.

          Although due to the way .NET works (the CLR and stuff) VB and C# can compile to the same IL (microsoft intermediate language) I find, and I suspect most do, that C# is much more human friendly in its syntax and semantics.

          You then get the added advantage of basically being able to program in Java as well. C# and Java are very, very similar. It's also similar enough to C and C++ that transitioning to those languages isn't hard syntactically. Although the concepts and techniques are harder.

          On top of that, should you get competent at C#, there is much much larger market for C# devs than VB.

          Comment

          Working...
          X