Javascript windows 8 wcf web服务(本地主机/内部网)

Javascript windows 8 wcf web服务(本地主机/内部网),javascript,wcf,web-services,windows-8,Javascript,Wcf,Web Services,Windows 8,我正在尝试从metro应用程序调用web服务。我正在用javascript开发应用程序,Web服务是基于wcf的 我这样试过: function callWCF() { WinJS.xhr({ type: "GET", url: "http://lei-023880-ws.sinternal.de:8732/sdata/myApp/myContract/-/employees", }).done( function (result) { console.log(resul

我正在尝试从metro应用程序调用web服务。我正在用javascript开发应用程序,Web服务是基于wcf的

我这样试过:

function callWCF() {
WinJS.xhr({
    type: "GET",
    url: "http://lei-023880-ws.sinternal.de:8732/sdata/myApp/myContract/-/employees",
}).done(
function (result) {
    console.log(result.responseText)       
},
function (request) {
}
);}
 var xhr = new XMLHttpRequest();
        xhr.open("GET", "http://lei-023880-ws.s.de:8732/sdata/myApp/myContract/-/$schema", true);
        xhr.responseType = "text";
        xhr.onreadystatechange = function () {
            if (xhr.readyState == xhr.DONE) {
                var blob = xhr.reponse;
                window.console.log(blob);
            }
        }
        xhr.send(); 
或者像这样:

function callWCF() {
WinJS.xhr({
    type: "GET",
    url: "http://lei-023880-ws.sinternal.de:8732/sdata/myApp/myContract/-/employees",
}).done(
function (result) {
    console.log(result.responseText)       
},
function (request) {
}
);}
 var xhr = new XMLHttpRequest();
        xhr.open("GET", "http://lei-023880-ws.s.de:8732/sdata/myApp/myContract/-/$schema", true);
        xhr.responseType = "text";
        xhr.onreadystatechange = function () {
            if (xhr.readyState == xhr.DONE) {
                var blob = xhr.reponse;
                window.console.log(blob);
            }
        }
        xhr.send(); 
所有im返回的都是网络错误,代码为:2efd。我用谷歌搜索了一下。这是一个“互联网无法连接”错误。当我将url更改为“microsoft.com”时,它工作正常。所以我想问题在于wcf服务? 在Windows8浏览器中调用URL时,它也可以工作。 为什么应用程序无法调用url

提前谢谢


robidd

自从microsoft.com运行以来,似乎在清单中设置了internet连接选项?(不想表现得很明显:),但我有几次忽略了这一点!)


你可以试试Fiddler,看看请求进行了多远——如果有的话。Windows 8中的Fiddler很棘手,但这篇文章应该可以帮助您进行设置:

是的,已设置internet。我安装了Fiddler和这个附加工具,但我没有更改任何代码,它突然工作了。奇怪的谢谢你的帮助,我也遇到了同样的问题。只有当Fiddler打开时,应用程序才能连接到我的服务。我的猜测是,它能够连接到Fiddler,而Fiddler作为一个桌面应用程序,对它的限制与开始菜单应用程序不同。