none
An error occurred while receiving the HTTP response to xxx problem. WCF comunication

    Question

  • I have been having this problem transmiting data (XML from a microsoft sincronization session v1.0) to a WCF service on IIS 6.
    I have enabled tracing on my WCF service, verbose, but nothing shows up. No exceptions what so ever.
    My client connects over a GPRS line. But i have also done this over ADSL with the same results.
    The thing is, it starts transmiting ( i can see it on wireshark) but suddenly the server side sends a TCP RST packet and the transmission ends with a client exception like

    An error occurred while receiving the HTTP response to http://blabalblabla/Service.svc. 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.

    It never actually gets to my code (otherwise i would probably see something on my trace)

    Thank you!

    My binding are this (on client):
    <basicHttpBinding>
    <
    binding name="BasicHttpBinding_Issap_mainSyncContract" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
    <
    readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
    <
    security mode="None">
       <
    transport clientCredentialType="None" proxyCredentialType="None" realm="" />
       <
    message clientCredentialType="UserName" algorithmSuite="Default" />
    </
    security>
    </
    binding>
    </
    basicHttpBinding>

    and on the server side:

    <basicHttpBinding>
            <binding name="BasicHttpBinding_Issap_mainSyncContract" closeTimeout="00:01:00"
              openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
              allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
              maxBufferSize="67108864" maxBufferPoolSize="67108864" maxReceivedMessageSize="67108864"
              messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
              useDefaultWebProxy="true">
              <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"
               maxBytesPerRead="8192" maxNameTableCharCount="2147483647" />
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
            </binding>
          </basicHttpBinding>

    <system.web>
        <compilation debug="true" />
        <httpRuntime maxRequestLength="2097151"/>
      </system.web>

    I have

    <

     

    dataContractSerializer maxItemsInObjectGraph="2147483647"/>

     

     

    on both sides.

     

     



     


     


    Web Developer
    Wednesday, May 20, 2009 2:17 PM

Answers

  • Two things:

    1. Whenever a client application throws a "an error occurred while receiving HTTP response...", most likely cause is that the service errored out without sending a response. Activity Tracing on System.ServiceModel and System.ServiceModel.MessageLogging should help you locate the error on the service side.

    2. I see that you are overriding maxItemsInGraph and maxRequestLength. Just curious, are you sending/receiving large amount of data. If so, the reader quotas at the binding level will have to be seen more carefully as well.
    Vivek Desai MCTS (WCF)
    • Marked as answer by Marco Zhou Friday, May 22, 2009 3:04 AM
    Thursday, May 21, 2009 4:57 AM

All replies

  • Two things:

    1. Whenever a client application throws a "an error occurred while receiving HTTP response...", most likely cause is that the service errored out without sending a response. Activity Tracing on System.ServiceModel and System.ServiceModel.MessageLogging should help you locate the error on the service side.

    2. I see that you are overriding maxItemsInGraph and maxRequestLength. Just curious, are you sending/receiving large amount of data. If so, the reader quotas at the binding level will have to be seen more carefully as well.
    Vivek Desai MCTS (WCF)
    • Marked as answer by Marco Zhou Friday, May 22, 2009 3:04 AM
    Thursday, May 21, 2009 4:57 AM
  • Hello Vivek.
    Tnks for you answer. As i stated before i have run the trace tool but nothing shows up.
    Nothing realy. No file is created.
    What i see on wireshark is a RST on the connection (server side) when its receiving things (XML)

    I am testing the worse case scenario, so yes, i am "uploading" about 3.5 mb (!!)

    If happen to have wireshark you can load this file into it.
    http://imediatavendingws.imediata.pt/trace_real_contra_iis.zip - rename it to pcap extension
    the last entry is the RST.

    My diagnostics config on the server side:
    <system.diagnostics>
        <sources>
          <source name="System.ServiceModel" switchValue="Verbose,ActivityTracing" propagateActivity="true">
            <listeners>
              <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                <filter type="" />
              </add>
              <add name="ServiceModelTraceListener">
                <filter type="" />
              </add>
            </listeners>
          </source>
        </sources>
        <sharedListeners>
          <add initializeData="xxxx\xxx\xxx\Web_tracelog.svclog"
            type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
            name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
            <filter type="" />
          </add>
        </sharedListeners>
        <trace autoflush="true" />
      </system.diagnostics>

    My bindigs on the server side are;

    <basicHttpBinding>
            <binding name="BasicHttpBinding_Issap_mainSyncContract" closeTimeout="00:01:00"
              openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
              allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
              maxBufferSize="67108864" maxBufferPoolSize="67108864" maxReceivedMessageSize="67108864"
              messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
              useDefaultWebProxy="true">
              <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
                maxArrayLength="2147483647" maxBytesPerRead="8192" maxNameTableCharCount="2147483647" />
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
            </binding>
          </basicHttpBinding>

    on the client side they are diferent but i dont realy know if it matters on the cliente side.

    <basicHttpBinding>
                  <binding name="BasicHttpBinding_Issap_mainSyncContract" closeTimeout="00:01:00"
                      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
                      allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                      maxBufferSize="2147483647" maxBufferPoolSize="2147483647"
                      maxReceivedMessageSize="2147483647" messageEncoding="Text"
                      textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
                      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
                          maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
                      <security mode="None">
                          <transport clientCredentialType="None" proxyCredentialType="None"
                              realm="" />
                          <message clientCredentialType="UserName" algorithmSuite="Default" />
                      </security>
                  </binding>
              </basicHttpBinding>

    One other thing to note.
    I if do this client-server transaction on my LAN between two PCs all is well.
    It seems to be something on TCP. could it be? Is it, usally?
    Tnks

    Web Developer
    • Proposed as answer by Red-VIII Thursday, January 28, 2010 5:15 PM
    Friday, May 22, 2009 5:40 PM
  • Hello Vivek.
    Tnks for you answer. As i stated before i have run the trace tool but nothing shows up.
    Nothing realy. No file is created.
    What i see on wireshark is a RST on the connection (server side) when its receiving things (XML)

    I am testing the worse case scenario, so yes, i am "uploading" about 3.5 mb (!!)

    If happen to have wireshark you can load this file into it.
    http://imediatavendingws.imediata.pt/trace_real_contra_iis.zip - rename it to pcap extension
    the last entry is the RST.

    My diagnostics config on the server side:
    <system.diagnostics>
        <sources>
          <source name="System.ServiceModel" switchValue="Verbose,ActivityTracing" propagateActivity="true">
            <listeners>
              <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                <filter type="" />
              </add>
              <add name="ServiceModelTraceListener">
                <filter type="" />
              </add>
            </listeners>
          </source>
        </sources>
        <sharedListeners>
          <add initializeData="xxxx\xxx\xxx\Web_tracelog.svclog"
            type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
            name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
            <filter type="" />
          </add>
        </sharedListeners>
        <trace autoflush="true" />
      </system.diagnostics>

    My bindigs on the server side are;

    <basicHttpBinding>
            <binding name="BasicHttpBinding_Issap_mainSyncContract" closeTimeout="00:01:00"
              openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
              allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
              maxBufferSize="67108864" maxBufferPoolSize="67108864" maxReceivedMessageSize="67108864"
              messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
              useDefaultWebProxy="true">
              <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
                maxArrayLength="2147483647" maxBytesPerRead="8192" maxNameTableCharCount="2147483647" />
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
            </binding>
          </basicHttpBinding>

    on the client side they are diferent but i dont realy know if it matters on the cliente side.

    <basicHttpBinding>
                  <binding name="BasicHttpBinding_Issap_mainSyncContract" closeTimeout="00:01:00"
                      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
                      allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                      maxBufferSize="2147483647" maxBufferPoolSize="2147483647"
                      maxReceivedMessageSize="2147483647" messageEncoding="Text"
                      textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
                      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
                          maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
                      <security mode="None">
                          <transport clientCredentialType="None" proxyCredentialType="None"
                              realm="" />
                          <message clientCredentialType="UserName" algorithmSuite="Default" />
                      </security>
                  </binding>
              </basicHttpBinding>

    One other thing to note.
    I if do this client-server transaction on my LAN between two PCs all is well.
    It seems to be something on TCP. could it be? Is it, usally?
    Tnks

    Web Developer

    Hi All,

    I am getting an error as "an error occurred while receiving HTTP response...",

    below i mentioned my config details and i set maxReceivedMessageSize="999999999"

    <bindings>
       <wsHttpBinding>
        <!--phtoRequest-->
        <binding name="WSHttpBinding_IShotRequestService" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="999999999" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
         <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
         <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
         <security mode="Message">
          <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
          <message clientCredentialType="Windows" negotiateServiceCredential="false" algorithmSuite="Basic128" establishSecurityContext="false"/>
         </security>
        </binding>
    </wsHttpBinding>

    when i am try to save some more records , i am getting this error..

    any help or suggestion will be appriciated

    Friday, August 28, 2009 6:51 AM
  • Hello,

    after wasting alot of time thinking it was my Enum or something else I figured out that I was simply returning alot of rows, around 18000. I know it's bad to return that many but at the same time I needed to in order to make my paging work properly in GridView so I let it be just for testing purposes not realizing that was the last thing I did before I broke it. There's probably a parameter I could have tweaked but this error is totally not specific and led me to a wild goose chase of creating new services, methods and all kinds of other impractical things that wasted my time.

    The WCF Tracing tool didn't work either since it kept showing me the same error as my exception.
    Thursday, October 22, 2009 3:18 PM
  • Did you turn on tracing on the service and the client? One of them should have shown you which quota you were exceeding


    Richard Blewett, thinktecture - http://www.dotnetconsult.co.uk/weblog2
    Twitter: richardblewett
    Thursday, October 22, 2009 3:34 PM
    Moderator
  • Yes I did. However tracing on the server didn't seem to produce the trace file. Documentation and examples I read didn't specify on which (Server or Client) I have to enable the tracing on but it worked on the client so I went with that.
    Friday, October 23, 2009 8:26 PM
  • This is probably happening at the server or you would get more info at the client. I made a short screencast about turning on tracing via the GUI to find serialization problems tool a while back - I would give it another go

    http://rocksolidknowledge.com/ScreenCasts.mvc/Watch?video=WCFTracing.wmv


    Richard Blewett, thinktecture - http://www.dotnetconsult.co.uk/weblog2
    Twitter: richardblewett
    Saturday, October 24, 2009 10:04 AM
    Moderator
  • You need to modify the config file in the web service to accept larger input strings.

    Adding the following line resolved this issue for me.
    <system.web>
       <httpRuntime maxRequestLength="32768" />
    </system.web>

    • Proposed as answer by Red-VIII Thursday, January 28, 2010 5:15 PM
    Thursday, January 28, 2010 5:14 PM
  • If you are returning an Entity using .net Framework 4.0 with a WCF method and getting this error then read this article:

    http://dotnet.dzone.com/news/entity-framework-4-wcf-lazy

     

     

     

     

    Thursday, May 20, 2010 8:32 PM
  • Thanks Red-VIII, your comment help me a lot, and i am able to solve my problem.

    Thanks,

    Brijen A. Patel

    Wednesday, September 15, 2010 11:52 AM
  • Thanks Red-VIII your solution worked for me . . .

    Blog

     

    • Proposed as answer by nISHi k Thursday, February 03, 2011 8:53 AM
    Thursday, February 03, 2011 8:52 AM
  • Thank you very much Red-VIII! Your solution solved my issue.
    Monday, May 16, 2011 5:59 PM
  • Could someone here please help me out. I am experiencing the same issue and am unable to solve the problem.

    Please take a look at this link for a summary of what I've done to try and resolve it.

    http://forum.winhost.com/showthread.php?t=9649

     


    Bill Yeager
    • Proposed as answer by Xorjas Tuesday, September 25, 2012 5:36 PM
    • Unproposed as answer by Xorjas Tuesday, September 25, 2012 5:36 PM
    Sunday, February 05, 2012 10:46 PM
  • Check the enums, that was my problem, my problem:

            

    [Flags]
        public enum EstadoTipoGestion { 
            ninguno = 0

        }

    i putted a new enum and bang it worked

    [Flags]
        public enum EstadoTipoGestion { 
            ninguno = 0,
            activo = 1
        }

    Tuesday, September 25, 2012 5:39 PM
  • Hello Red-VIII,

    The solution you mentioned was working fine. But my requirment in httpRuntime maxRequestLength=90000.

    Will it be possible?

    Because when we apply your solution with value = 90000, it throwing error.

    Please help me out in this.

    Thanks

    Tarun 1

    Thursday, April 24, 2014 7:43 PM