System.ServiceModel.CommunicationException: The underlying connection was closed

后端 未结 5 2023
粉色の甜心
粉色の甜心 2020-12-31 04:14

I am retrieving data from a wcf web service and when data is more than 0.2 million records i get an exception which is as under:

System.ServiceModel.Communi         


        
5条回答
  •  囚心锁ツ
    2020-12-31 05:02

    I had recently the same problem with a Wcf service within a .Net 4.0 web app. I increased the maxItemsInObjectGraph value and server didn't throw the exception anymore. The documentation here says the default maximum is Int32.MaxValue but I think it is incorrect, the maximum value is 65535.

       
        
          
          
          
        
      
    

    The other thing you can do is enable tracing. This is an example of what I have in the web.config:

    
      
        
          
            
          
        
      
    
    

    If you double click on the Traces.svclog, windows should open the Microsoft Service Trace Viewer.

    If you test your service with the Microsoft WCF Test Client make sure you change the default client config to match the server settings (this includes the client endpoint behavior) to make sure the client can receive the response from the server.

    I hope this helps.

提交回复
热议问题