2011-03-21 41 views
1

我收到以下錯誤錯誤,同時增加了服務的參考

The document at the url was not recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from ' is 'The document format is not recognized (the content type is 'text/html;charset=UTF-8').'.
- Report from 'DISCO Document' is 'There was an error downloading
.svc?disco'.'.
- The remote name could not be resolved:
- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html;charset=UTF-8').'.
- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html;charset=UTF-8').'. Metadata contains a reference that cannot be resolved: ' '. Content Type application/soap+xml; charset=utf-8 was not supported by service . The client and service bindings may be mismatched. The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'.. If the service is defined in the current solution, try building the solution and adding the service reference again.

+0

你有沒有運氣? – 2011-03-25 00:21:46

回答

1

的關鍵是在該行:

The remote name could not be resolved: 'imriskserver-02'

它看起來像你的服務器是不知道 - 可以使用你ping服務器名字? IP地址如何?

如果您發現可以通過IP地址而不是通過名稱聯繫服務器,那麼名稱解析失敗。您可以通過editing the hosts file解決此問題。只要服務器IP地址不變,這將工作。

有關主機名稱解析TechNet的詳細信息。

+0

我能ping通服務器使用ip地址,但不使用名稱 – 2011-03-21 23:47:09

+0

如果我必須使用ipaddress我如何更改和我需要做出更改 – 2011-03-21 23:51:12

+0

@Peddireddy:可能更容易編輯主機文件 - 請參閱鏈接在我的答案。 – 2011-03-22 00:05:33

0

將Web服務添加到VS項目後,您是否更改了Web服務?我會更新它或再次添加它。

+0

我正在嘗試添加僅使用IP地址的引用 – 2011-03-21 23:29:23

+0

我在添加服務引用時收到此錯誤 – 2011-03-21 23:44:58

+0

錯誤表示無法聯繫服務器 - 因此無法更新服務引用。 – 2011-03-22 00:06:25