Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
chriscammers
Partner - Specialist
Partner - Specialist

Web Service Call works locally but Fails on Access Point

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();

4 Replies
Not applicable

Do you get any error messages? Where in the code does the problem occur?

chriscammers
Partner - Specialist
Partner - Specialist
Author

My Apologies,

The only error I am seeing is the result of the error function from the web service call.

Not applicable

Nothing else in the javascript/Firebug console?

Have you looked into troubleshoting cross domain requests? Maybe it's a problem with Access-control-allow-origin. It might help look into that!

//Mikael

Not applicable

Did you ever solve this? I have a similar issue where code works great in IE, but in the extension object it does not.