locked
Neither receiving success nor error from Azure query

    Question

  • I'm trying to load data stored in a mobile Service of Windows azure.

    function fillHighScoresList_TPS() {
            var highscore_tps = client.getTable("highscore_tps");
            highscore_tps.select("user", "tps").read({
                success: function (results) {
                    console.log(results);
                    document.getElementById('command').innerText = JSON.stringify(results);
                },
                error: function (err) {
                    console.log(results);
                    document.getElementById('command').innerText = JSON.stringify(err);
                }
            });
        }

    Accessing the Service and table should work well - because the snippet:

     // Show Highscore Tabs
                var item = {
                    user: "Demo",
                    tps: scoreboard.tps
                };
                client.getTable("highscore_tps").insert(item);

    works well and the demo score gets inserted.

    When trying to select the records however I never seem to get in either the success or error part.
    Debugging with fiddler is not possible because it's https - I'm a bit puzzled what is going wrong - it seems the async call NEVER gets a Response.

    I'd be grateful for input
    Kind regards

    Tuesday, February 26, 2013 7:19 PM

Answers

  • Hi DB,

    Actually Fiddler works fantastic for debugging HTTPS and Windows Store apps.  Simply enable Win8 apps and HTTPS decryption.

    That aside...

    You are using the wrong syntax.  Download the sample that is provided when you create a service and you will see the syntax follows a promise paradigm (essential to Windows Store apps written in JavaScript).

    You would want something similar to this:

     var refreshTodoItems = function () {
                    // This code refreshes the entries in the list view be querying the TodoItems table.
                    // The query excludes completed TodoItems                
                    todoTable.where({ complete: false }).select("id","text")
                       .read()
                        .done(function (results) {
                            todoItems = new WinJS.Binding.List(results);
                            listItems.winControl.itemDataSource = todoItems.dataSource;
                        });
                };
    -Jeff
     

    Jeff Sanders (MSFT)

    Tuesday, February 26, 2013 8:00 PM
    Moderator

All replies

  • Hi DB,

    Actually Fiddler works fantastic for debugging HTTPS and Windows Store apps.  Simply enable Win8 apps and HTTPS decryption.

    That aside...

    You are using the wrong syntax.  Download the sample that is provided when you create a service and you will see the syntax follows a promise paradigm (essential to Windows Store apps written in JavaScript).

    You would want something similar to this:

     var refreshTodoItems = function () {
                    // This code refreshes the entries in the list view be querying the TodoItems table.
                    // The query excludes completed TodoItems                
                    todoTable.where({ complete: false }).select("id","text")
                       .read()
                        .done(function (results) {
                            todoItems = new WinJS.Binding.List(results);
                            listItems.winControl.itemDataSource = todoItems.dataSource;
                        });
                };
    -Jeff
     

    Jeff Sanders (MSFT)

    Tuesday, February 26, 2013 8:00 PM
    Moderator
  • Thank you, I seem to have missed that example - I only found the insert code and the functions at the MSDN

    Tuesday, February 26, 2013 9:44 PM