2011-03-04 40 views
0

我做的方法一個破發點,但它永遠不會去那裏並且如果粘貼在網頁瀏覽器的網址並回車,這就是我得到在Firebug:localhsot的DNS查找失敗。沒有這樣的主機被稱爲

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 

? 

什麼可能是錯了嗎?

END EDIT

我有一個WCF使用具有填充JSON服務創建(http://msdn.microsoft.com/en-us/library/cc716898(v=vs.90).aspx)

我有下面的代碼,我用來調用服務,並且這個代碼是在HTML頁面的同一個項目,我創建了wcf服務。

$("#btn").click(function (event) { 

      $.getJSON('http://localhsot:2344/Service1.svc/GetCurrentUser?method=?', { }, 
      function (data) { 
       debugger 
       alert(data); 
      }); 
      //return false; 
     }); 

收到此錯誤:

爲localhsot DNS查找失敗。沒有這樣的主機被稱爲

+0

恩,也許嘗試** localhost **,不localhsot。 – 2011-03-04 15:39:09

回答

1

嘗試重命名:

localhsot =>localhost

+0

更新了我的問題 – 2011-03-04 15:49:59

+0

@Abu Hamzah,是否調用了Web方法?如果你在裏面放置一個斷點,它會被擊中嗎? Web服務是否啓動?如果在地址欄中直接輸入「http:// localhost:2344」,會發生什麼? – 2011-03-04 15:53:01

+0

更新了我的問題 – 2011-03-04 15:58:24

0

你拼寫錯了本地主機。看看你的網址並修正拼寫錯誤。

+0

更新了我的問題 – 2011-03-04 15:50:43

相關問題