2013-07-25 135 views
3

我有URL以Web服務的WSDL:無法添加在Visual Studio中使用WSDL服務引用

http://www.webservicex.net/WeatherForecast.asmx?WSDL

我試圖消耗在WPF應用程序在Visual這項服務(.NET 4.5)工作室2012年

我右鍵點擊項目 - >添加服務引用,當我嘗試添加上述服務的參考,我得到以下錯誤:

The HTML document does not contain Web service discovery information. Metadata contains a reference that cannot be resolved: ' http://www.webservicex.net/WeatherForecast.asmx?WSDL '. Metadata contains a reference that cannot be resolved: ' http://www.webservicex.net/WeatherForecast.asmx?WSDL '. If the service is defined in the current solution, try building the solution and adding the service reference again.

在「添加服務參考」窗口中,我現在點擊底部的「高級」按鈕 - >「添加Web引用」按鈕 - >將URL複製到URL文本框中並單擊「 - >」按鈕。我在查看器中看到WSDL。

現在我點擊「取消」並再次點擊「服務參考設置」窗口中的「取消」。

在「添加服務參考」窗口中,我現在單擊「開始」,我看到可用服務添加到項目中。

這是Visual Studio的問題嗎?爲什麼我必須這樣做。爲什麼第一次不行?我在我的機器上丟失了什麼嗎?

回答

0

我試圖 '添加服務引用' 你在Microsoft Visual Studio 2010(版10.0.40219.1 SP1Rel),微軟的Visual Studio 2012旗艦版(版11.0.61030.00更新4),並提供該網址在微軟Visual Studio終極2013年(版本12.0.30501.00更新2),它的工作完美的所有。

所以我可以假設3個選項。

  1. 這是Visual Studio 2012中的錯誤,但它在最新的更新之一中修復。
  2. 您嘗試使用的服務的WSDL中的某些內容發生了更改,現在此WSDL不會觸發您遇到的錯誤。
  3. 這個問題總是與你的VS 2012的安裝有關,只是由於某種原因(安裝了錯誤的VS插件等)。
相關問題