localhsot 的 DNS 查找失败。没有这样的主机是已知的
我在该方法上做了一个断点,但它永远不会去那里,而且如果将网址粘贴到网络浏览器中并按 Enter 键,这就是我在 Firebug 中得到的:
ReadResponse() failed: The server did not return a response for this request.
编辑:
确实这是拼写错误,在更正它之后,我仍然没有回复,在 FF 中我看到回复
GET GetCustomer?method=jsonp1299253547713
http://localhost:2344/service1.svc/GetCustomer?method=jsonp1299253547713
Aborted
localhost:2344
?
可能有什么问题?
结束编辑
我有一个使用带有填充的json创建的wcf服务(http://msdn.microsoft.com/en-us/library/cc716898(v=vs.90).aspx)
我有下面的代码是我用来调用服务的,该代码位于我创建 wcf 服务的同一项目内的 html 页面中。
$("#btn").click(function (event) {
$.getJSON('http://localhsot:2344/Service1.svc/GetCurrentUser?method=?', { },
function (data) {
debugger
alert(data);
});
//return false;
});
收到此错误:
localhsot 的 DNS 查找失败。不知道这样的主机
i did a break point on the method but it never goes there and also if paste the url in the web browser and hit enter and this is what i get in Firebug:
ReadResponse() failed: The server did not return a response for this request.
EDIT:
indeed that was typo, after correcting it and i still have no response, in FF i see the response
GET GetCustomer?method=jsonp1299253547713
http://localhost:2344/service1.svc/GetCustomer?method=jsonp1299253547713
Aborted
localhost:2344
?
what may be wrong ?
END EDIT
i have a created wcf services using json with padding (http://msdn.microsoft.com/en-us/library/cc716898(v=vs.90).aspx)
i have the code below that i am using to call the service, and this code is in html page withint th same project that i have created the wcf service.
$("#btn").click(function (event) {
$.getJSON('http://localhsot:2344/Service1.svc/GetCurrentUser?method=?', { },
function (data) {
debugger
alert(data);
});
//return false;
});
getting this error:
DNS Lookup for localhsot failed. No such host is known
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试重命名:
localhsot
=>本地主机Try renaming:
localhsot
=>localhost
你把 localhost 拼写错了。查看您的网址并修复拼写错误。
You spelled localhost wrong. Look at your url and fix the spelling error.