远程服务器返回错误:NotFound

时间:2010-05-27 12:10:38

标签: web-services exception silverlight-4.0

我正在尝试在旧的Web服务中检索字符串,但它给我一个

的错误
  

远程服务器返回错误:NotFound。

并且其InnerException是

  

{System.Net.WebException:远程服务器返回错误:NotFound。 ---> System.Net.WebException:远程服务器返回错误:NotFound。      在System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)      在System.Net.Browser.BrowserHttpWebRequest。<> c__DisplayClass5.b__4(Object sendState)      在System.Net.Browser.AsyncHelper。<> c__DisplayClass2.b__0(Object sendState)      ---内部异常堆栈跟踪结束---      在System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod,Object state)      在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,而我的ServiceReferences.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>

任何帮助都会得到很好的谢谢。

2 个答案:

答案 0 :(得分:2)

这个特定的错误可能意味着什么,它只是WCF用来说“出错了”的一般错误。跟踪它很容易,只需参考Microsoft的Service Trace Viewer工具生成的日志即可。阅读它right here。它将在您选择的文件夹中吐出一个日志文件,并使用跟踪查看器,您将很快发现错误的呼叫。

答案 1 :(得分:1)

我通过调试遗留的Web服务解决了这个问题。它是一个失踪的dll。 有关如何调试的步骤在here