2011-05-11 51 views
2

我試圖從另一個C#調用函數從ReportingServices2005.asmx Web服務GetReportParameters方法和我收到以下錯誤,當一個NotImplementedException:我得到試圖調用報告服務Web方法

System.NotImplementedException: The method or operation is not implemented. 

我litterally剛纔複製的代碼從微軟的網站在這裏:

Get Parameters Example

這是該代碼:

  bool forRendering = false; 
      string historyID = null; 
      ParameterValue[] values = null; 
      DataSourceCredentials[] credentials = null; 
      ReportParameter[] parameters = null; 

      try 
      { 
       parameters = rs.GetReportParameters(reportName,historyID, forRendering, values,credentials); 

       if (parameters != null) 
       { 
        foreach (ReportParameter rp in parameters) 
        { 
         Console.WriteLine("Name: {0}", rp.Name); 
        } 
       } 
      } 

      catch (SoapException e) 
      { 
       error = e.Detail.InnerXml.ToString(); 
      } 

其中reportName是一個帶有報告名稱的字符串。

任何想法??

在此先感謝!

編輯

以下是完整的堆棧跟蹤:

System.NotImplementedException: The method or operation is not implemented. 
at Foo.Foo.ReportingService2005.GetReportParameters(String reportName, String historyID, Boolean forRendering, ParameterValue[] values, DataSourceCredentials[] credentials) in C:\Visual Studio Projects\Foo\Foo\Web References\Foo\Reference.cs:line 4112 
at Foo.Foo.GetReportParameters(String username, String password, String reportName) in C:\Visual Studio Projects\Foo\Foo\Foo.asmx.cs:line 265 
+1

你可以添加更多的堆棧跟蹤到你的問題嗎?通常IME一個NotImplementedException必須從一個方法顯式拋出,該方法的主體只包含'throw new NotImplementedException();' – 2011-05-11 21:24:45

+0

我添加了堆棧跟蹤,看起來像是從'Resources.cs'中產生共鳴......我甚至沒有確定文件位於我的項目中的位置.. – AngeloS 2011-05-12 13:07:37

+0

Typo,我的意思是'Reference.cs' – AngeloS 2011-05-12 13:19:29

回答

0

我刪除並重新添加Web引用,這並沒有這樣的伎倆,但大量的試驗和錯誤後我注意到,

ParameterValue[] values = null; 
DataSourceCredentials[] credentials = null; 
ReportParameter[] parameters = null; 

都引用另一個Web引用....甚至不知道如何是可能的。但是,我刪除了其他Web與Reporting Services無關的所有參考資料現在都在運行。