4 Replies Latest reply: Oct 24, 2014 9:05 AM by James Pike RSS

    Web Service Call works locally but Fails on Access Point

    Chris Cammers

      I have the following code running successfully in an extension that pulls data from a web service.

       

      The extension is installed locally on my desktop and works fine when I move it to the server it seems like the server cannot reach the webservice.

       

      Does anybody have any suggestions for figuring out what is causing the error?

       

      Thanks

       

      var ExtensionPath = Qva.Remote + (Qva.Remote.indexOf('?') >= 0 ? '&' : '?') + "public=only&name=TestExtension";
      
      
      //function GroupEditor_Debug() {
      //    Qva.LoadScript(ExtensionPath + "/jquery-1.9.1.min", GroupEditor_Ready);
      //};
      
      
      function GroupEditor_Ready() {
      
      
          Qv.AddExtension("TestExtension", function () {
      
      
              var _this = this;
        getUserGroupsData();
      
      
              function getUserGroupsData() {
      
      
                  
        var webServiceUrl = "http://somehost/Stacker/QVDataService.asmx/HelloWorld";
      
      
        jQuery.support.cors = true;
        $.ajax({
                      type: "POST",
                      url: webServiceUrl,
                      data: "{}",
                      contentType: "application/json; charset=utf-8",
                      dataType: "json",
                      success: function (data) {
        //alert(data.d);
        //table =  LoadGroups(data);
        _this.Element.innerHTML = data.d
        table = data.d;
        return table;
                      },
                      error: function (xhr) {
                          alert('Ajax Error:' + JSON.stringify(xhr));
                      }
        });
              }
      
          })
      };
      
      
      GroupEditor_Ready();