facebook

Need Example of calling a web service in JavaScript: CLOSED

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #341678 Reply

    Pauldivaniii
    Member

    Are there any examples you can share that illustrates how to call a web service from JavaScript?

    #341708 Reply

    Hi Pauldivaniii,

    MobiBike-News – RSS Reader Example should be helpful for getting started.

    #341718 Reply

    Pauldivaniii
    Member

    Thanks
    I’ll offer this bit of code from my solution:

    function GetMissionList(pageNumber) {
    //Calling WCF Service using jQuery ajax method
    $.ajax({
    type: “GET”,
    async: “false”,
    url: “http://localhost:7100/CommandCenter.svc/GetMissions(” + pageNumber.toString() + “, 20, 0)”,

    contentType: “application/json; charset=utf-8”,
    dataType: “json”,
    processData: true,
    success: function (missions) {
    NewMissionList(missions);
    },
    error: function (xhr) {
    //alert(xhr.responseText);
    alert(“Service Call Failed”);
    }
    });
    }

    function NewMissionList(missionPage) {
    //
    // Do your thing with the missionPage class
    //
    }

    #341737 Reply

    Hi Pauldivaniii,

    Thanks for the follow up and for sharing your code example. Marking thread as closed.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Need Example of calling a web service in JavaScript: CLOSED

You must be logged in to post in the forum log in