2017-09-02 89 views
0

我正在嘗試使用來自Microsoft的一個名爲WordCount的流行示例來了解服務結構 的開發過程。 我還沒有Azure帳戶,所以我在我的Windows 10上安裝了本地羣集 。我瀏覽了微軟 網站上的說明,其中大部分都適用。我可以看到在羣集管理器:Microsoft示例WordCount在本地羣集上不起作用

http://localhost:19080/Explorer 

在那裏我可以看到應用程序:

fabric:/WordCount WordCount 1.0.0 OK Ready 

從Powershell的裏面我可以連接到本地集羣 與輸出運行的cmdlet預期

Get-ServiceFabricApplication 
Get-ServiceFabricService -ApplicationName 'fabric:/WordCount' 
Get-ServiceFabricPartition 'fabric:/WordCount/WordCountService' 

問題是,當我運行

http://localhost:8081/wordcount/index.html 

瀏覽器不顯示任何內容。它應該顯示 由客戶端JavaScript 生成並由ASP.NET Web API處理的單詞的計數。我的瀏覽器啓用了JavaScript。

我對樣本中的代碼還不夠了解,但我有用VS2017加載的4個項目的解決方案。我只是想盡快讓它工作。

下面我在瀏覽器(FireFox)中附加了控制檯輸出的一部分。顯然,JS腳本得到了

[HTTP/1.1 404 Not Found 0ms] 

響應所有請求。

POST 
XHR 
http://localhost:8081//wordcount/index.html/api/AddWord/WYVyl [HTTP/1.1 404 Not Found 0ms] 
XML Parsing Error: no root element found 
Location: http://localhost:8081//wordcount/index.html/api/AddWord/WYVyl 
Line Number 1, Column 1: WYVyl:1:1 
POST 
XHR 
http://localhost:8081//wordcount/index.html/api/AddWord/YcIMv [HTTP/1.1 404 Not Found 0ms] 
XML Parsing Error: no root element found 
Location: http://localhost:8081//wordcount/index.html/api/AddWord/YcIMv 
Line Number 1, Column 1: YcIMv:1:1 
GET 
XHR 
http://localhost:8081//wordcount/index.html/api/Count [HTTP/1.1 404 Not Found 0ms] 
XML Parsing Error: no root element found 
Location: http://localhost:8081//wordcount/index.html /api/Count?c=0.7465426272903215 
Line Number 1, Column 1: Count:1:1 
+0

你確定你有正確的地址(http:// localhost:8081/wordcount/index.html )?你是否收到任何服務器端或客戶端錯誤。你說「瀏覽器不顯示任何東西」 - >所以它保持空白,沒有javascript錯誤報告等。 –

+0

我編輯發佈添加一些更多的信息。瀏覽器正在向所有請求獲取[HTTP/1.1 404 Not Found 0ms] –

+0

您能否包含示例代碼的鏈接? –

回答