Click here to Skip to main content
13,595,908 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
hi friendz,
i am getting the huge amount of data(Contacts) from Sql server..i am getting the following error...

Error:

An error occurred while receiving the HTTP response to http://localhost:8732/Design_Time_Addresses/ICloudServices/ContactService/. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.

{"The underlying connection was closed: An unexpected error occurred on a receive."}

My wcf web.config file:
<service name="ICloudServices.ContactService">
   <endpoint address="" binding="basicHttpBinding" contract="ICloudServices.IContactService">
     <identity>
       <dns value="localhost" />
     </identity>
   </endpoint>
   <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
   <host>
     <baseAddresses>
       <add baseAddress="http://localhost:8732/Design_Time_Addresses/ICloudServices/ContactService/" />
     </baseAddresses>
   </host>
 </service>


<bindings>
    <basicHttpBinding>
      <binding name="basicHttpBindingSettings"  openTimeout="00:01:00" receiveTimeout="05:00:00" sendTimeout="05:00:00" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" messageEncoding="Text">
        <readerQuotas maxDepth="128" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      </binding>
    </basicHttpBinding>
  </bindings>
  <behaviors>
    <serviceBehaviors>
      <behavior>
        <dataContractSerializer maxItemsInObjectGraph="2147483647" />

        <!-- To avoid disclosing metadata information,
        set the value below to false and remove the metadata endpoint above before deployment -->
        <serviceMetadata httpGetEnabled="True"/>
        <!-- To receive exception details in faults for debugging purposes,
        set the value below to true.  Set to false before deployment
        to avoid disclosing exception information -->
        <serviceDebug includeExceptionDetailInFaults="False" />
      </behavior>
    </serviceBehaviors>
  </behaviors>


Thanks in advance
Posted 4-Jul-12 1:31am
Comments
CDP1802 4-Jul-12 7:40am
   
Are the answers you are getting for a similar question you obviously posted with another account (http://www.codeproject.com/Questions/415508/The-underlying-connection-was-closed-An-unexpected) not good enough?
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Here this kind of exception can happen if your receiveTimeout is not large enough.
Here in your configuration, you are setting
receiveTimeout="05:00:00"
in "binding name="basicHttpBindingSettings" " but you are not associating it with your end point.
Either remove the name attribute from the binding so that basicHttpBinding will use it as default binding configuration. Or add
bindingConfiguration="basicHttpBindingSettings"
to your basicHttpBinding endpoint. Hope this will work.
  Permalink  
v4
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web04 | 2.8.180621.3 | Last Updated 6 Jul 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100