简体   繁体   English

执行服务方法后的WCF。 System.ServiceModel.CommunicationException:远程服务器返回错误:NotFound

[英]WCF after executing service method. System.ServiceModel.CommunicationException: The remote server returned an error: NotFound

I am getting the error inconsistently, 我不一致地得到错误,

  1. After successful execution of service method (In between data pass between service & client) 成功执行服务方法后(在服务和客户端之间的数据传递之间)

  2. While execution service method itself. 同时执行服务方法本身。

  3. It will execute without causing any issue if the we play with low data [Thousands of data in CSV & DB] 如果我们处理低数据[CSV和DB中的数千个数据],它将执行而不会引起任何问题

I have google & tried lot in config files, Please help me out if anything need to check in IIS level. 我有google&在配置文件中尝试过很多,如果需要检查IIS级别,请帮帮我。

Scenario: 场景:

I uploading the file(CSV), which contains 1,00,000 (1 Lakh) records & DB also contains 1 lakh records & the requirement is to compare each record of csv with DB records & give the consolidated output which are the records are different(By comparing each fields). 我上传的文件(CSV)包含1,00,000(10万)条记录,数据库还包含10万条记录,要求是将csv的每条记录与DB记录进行比较并给出合并的输出,这是记录不同的原因(通过比较每个字段)。

Client to Service : File is transfered via bytes format Service to Client : Collection object [Generic List format] 客户端到服务:文件通过字节格式传输客户端到服务:集合对象[通用列表格式]

Technologies & Codes used Entity framework-4 used to fetch initial records. 使用的技术和代码 Entity framework-4用于获取初始记录。 Used normal foreach/for loop for making comparision. 使用普通的foreach / for循环进行比较。 switch used for field comparision. 用于现场比较的开关。 WCF, Silverlight, c# & .Net 4.5 WCF,Silverlight,C#和.Net 4.5

Below are my settings, 以下是我的设置,

Service Config: 服务配置:

    <basicHttpBinding>
    <binding name="basicHttpBinding_IUploadService" maxBufferPoolSize="2147483647" closeTimeout="00:45:00"
              openTimeout="00:45:00" receiveTimeout="00:45:00" sendTimeout="00:45:00" maxBufferSize="2147483647"
                        maxReceivedMessageSize="2147483647">
              <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
                    maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
              <security mode="Transport">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
            </binding>
    </basicHttpBinding>

<service name="Namespace.UploadService">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_IUploadService"
           contract="Namespace.IUploadService" >
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>

<behavior name="">
          <serviceMetadata httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <ServiceErrorBehaviour/>

</behavior>

Client Config: 客户端配置:

<binding name="BasicHttpBinding_IUploadService" closeTimeout="00:45:00"
          openTimeout="00:45:00" receiveTimeout="00:45:00" sendTimeout="00:45:00"
          maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
          <security mode="Transport" />
</binding>

<endpoint address="https://localhost/URL/Upload.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IUploadService"
        contract="UploadService.IUploadService" name="BasicHttpBinding_IUploadService" />

Web Config: 网络配置:

<system.web>
    <compilation debug="true" targetFramework="4.5"/>
    <authentication mode="Windows"/>
    <httpRuntime maxRequestLength="2147483647" executionTimeout="2700" enableVersionHeader="false"/>
    <pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID"/>
  </system.web>

Error: 错误:

System.ServiceModel.CommunicationException: The remote server returned an error: NotFound. ---> 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__DisplayClassa.<EndGetResponse>b__9(Object sendState)
   at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__0(Object sendState)
   --- End of inner exception stack trace --- & ...

Bytes Size Client to server(input): 10Mb [In bytes format] & Server to client(output): if its small amount then fine else issue [expecting morethan input size] 客户端到服务器(输入)的 字节大小 10Mb [以字节格式]和服务器到客户端(输出)的信息:如果它的数量少,那么就可以了,否则,将发出[期望超过输入大小]

Also using https NOT http . 还使用https NOT http

Thanks, S.Venkatesh 谢谢,S.Venkatesh

Silverlight always throws NotFound if the WCF throws an error, because the HTTP response code would be 500: this error code forces Silverlight to throw NotFound. 如果WCF抛出错误,Silverlight总是抛出NotFound,因为HTTP响应代码为500:此错误代码迫使Silverlight抛出NotFound。

So, first of all try to debug the WCF while doing this call. 因此,首先在进行此调用时尝试调试WCF。 If you can't do that, make the WCF log the error somewhere. 如果无法执行此操作,请使WCF将错误记录在某处。 If you like having the correspondent error thrown on the silverlight side, you have to use a server WCF behavior that makes the WCF answer with 200 code even if an error occurred. 如果您希望在Silverlight方面抛出相应的错误,则必须使用服务器WCF行为,即使发生错误,该行为也会使WCF用200个代码回答。

More information here: http://msdn.microsoft.com/en-us/library/ee844556(v=vs.95).aspx 此处的更多信息: http : //msdn.microsoft.com/zh-cn/library/ee844556(v=vs.95).aspx

I have encountered similar errors in the past and most of the time it was the WCF Service that was failing to: ex some exception not related to communication part of it. 我过去和大多数时间都遇到过类似的错误,这是WCF服务无法完成的:与通讯部分无关的一些异常。

If its possible debug the WCF Service itself; 如果可能,请调试WCF服务本身。 Alternately you can setup tracing using following utility and make sure that WCF is returning the call properly: 或者,您可以使用以下实用程序来设置跟踪,并确保WCF正确返回了呼叫:

http://msdn.microsoft.com/en-us/library/ms732023.aspx http://msdn.microsoft.com/en-us/library/ms732023.aspx

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Silverlight客户端的WCF服务会抛出System.ServiceModel.CommunicationException - Silverlight client consuming WCF service throws System.ServiceModel.CommunicationException WCF远程处理客户端连接错误:System.ServiceModel.CommunicationException - WCF remoting client connection error: System.ServiceModel.CommunicationException 解析WCF ProtocolException时出现System.ServiceModel.CommunicationException - System.ServiceModel.CommunicationException when parsing WCF ProtocolException 远程服务器返回错误:NotFound WCF服务 - The remote server returned an error: NotFound WCF Service 尝试通过WCF传递位图时出现“ System.ServiceModel.CommunicationException” - “System.ServiceModel.CommunicationException” when trying to pass a bitmap through WCF WCF错误:System.ServiceModel.CommunicationException已超过传入消息的最大消息大小配额 - WCF error: System.ServiceModel.CommunicationException the maximum message size quota for incoming messages has been exceeded Windows Phone 8 CommunicationException远程服务器返回错误:NotFound - Windows phone 8 CommunicationException The remote server returned an error: NotFound Web服务重载时出现System.ServiceModel.CommunicationException - System.ServiceModel.CommunicationException on overloading webservice System.ServiceModel.CommunicationException:'服务端点未能侦听 URI'xxx',因为访问被拒绝 - System.ServiceModel.CommunicationException: 'The service endpoint failed to listen on the URI 'xxx' because access was denied WCF服务引用调用返回“远程服务器返回错误:NotFound。” - WCF Service Reference call returning “The remote server returned an error: NotFound.”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM