2010-05-27 200 views
1

我想在我的舊網絡服務來獲取一個字符串,但它給我的遠程服務器返回錯誤:NOTFOUND

The remote server returned an error: NotFound.

一個錯誤,它的InnerException是

{System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound. at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.b__4(Object sendState) at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.b__0(Object sendState) --- End of inner exception stack trace --- at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state) at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)}

這是提示錯誤的方法,此方法返回字符串格式

void client_ValidateUserEncryptedCompleted(object sender, DummyWS.ValidateUserEncryptedCompletedEventArgs e) 
    { 
     object token = e.Result; 
     client = new DummyWS.MachineHistoryWSSoapClient(); 
     if (token != null) 
     { 
      client.GetSummaryXMLAsync(token, "", ""); 
     } 
    } 

我目前使用Silverlight 4.0和我的Ser viceReferences.ClientConfig是

<configuration> 
<system.serviceModel> 
    <bindings> 
     <basicHttpBinding> 
      <binding name="MachineHistoryWSSoap" maxBufferSize="2147483647" 
       maxReceivedMessageSize="2147483647"> 
       <security mode="None" /> 
      </binding> 
     </basicHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="http://localhost/MHVwsModified/MachineHistoryWS.asmx" 
      binding="basicHttpBinding" bindingConfiguration="MachineHistoryWSSoap" 
      contract="DummyWS.MachineHistoryWSSoap" name="MachineHistoryWSSoap" /> 
    </client> 
</system.serviceModel> 

我在我的web服務Web.Config是

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> 
<system.web> 
    <compilation debug="true"> 
     <assemblies> 
      <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /></assemblies></compilation> 
    <authentication mode="Windows" /> 
</system.web> 
<system.webServer> 
    <directoryBrowse enabled="true" /> 
</system.webServer> 

任何幫助將aprreciated謝謝。

回答

1

我通過調試我的遺留Web服務解決了這個問題。它是一個缺少的DLL。 關於如何調試的步驟是here

2

這個特定的錯誤可能意味着什麼,它只是WCF用來說「出錯了」的一般錯誤。跟蹤它很簡單,只需參考Microsoft提供的服務跟蹤查看器工具生成的日誌即可。閱讀關於它right here。它會在您選擇的文件夾中吐出一個日誌文件,使用跟蹤查看器可以快速發現錯誤的呼叫。

+0

嗨!我將MessageLogging放在我的Web服務 和我的客戶端中的web.config中的Web.Config中,但其traces.svclog爲空。 – xscape 2010-05-28 03:15:15

+0

+1「這只是WCF用來說出錯的一般錯誤」 – MCS 2011-01-05 16:36:46

相關問題