2011-04-28 76 views
1

我有一個WCF服務,它調用運行在我的開發IIS服務器(IIS 7)上的web服務。我已經將它作爲C#網站項目的服務參考添加了,並且增加了它。WCF服務器錯誤。響應消息的內容類型text/html與綁定的內容類型不匹配

然而,當我嘗試調用任何服務合約,我得到以下錯誤:事先

The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were:
'Blocked Web Page

感謝

BB

回答

4

錯誤消息說,它明確:你'取回一個HTML頁面而不是你的服務響應。查看錯誤消息中列出的頁面片段,您可能未使用該服務進行authroroized。

嘗試連接到瀏覽器中的服務網址 - 您應該可能會看到一個頁面,說明您不允許訪問該網頁。最有可能的是,這是一個權限問題。

+0

@ marc_s謝謝。我可以在瀏覽器中連接到服務。 – BumbleBee 2011-04-28 18:19:16

+2

@BumbleBee>如果您認爲這個問題得到解答,請將其標記爲已回答。 – 2011-05-27 11:33:38

相關問題