WCF weird behavior. (An error occurred while receiving the HTTP response)
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: WCF weird behavior. (An error occurred while receiving the HTTP response)

  1. #1
    Join Date
    Jan 2008
    Posts
    60

    WCF weird behavior. (An error occurred while receiving the HTTP response)

    I'm receiving this weird exception when calling a WCF function that returns a list of items. apparently when the size of list gets bigger this exception is thrown.

    "An error occurred while receiving the HTTP response to http://localhost:8731/WMON/Database/...CeDBWcfService. 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 WCF service functions properly because when the client calls the function, it gets called from the service end point (I tested by placing a break point). Also the service has not shut down because on a multiple attempt of calling the function after the exception is thrown, the service code gets executed (tested using break points again). What could this error be?

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,416

    Re: WCF weird behavior. (An error occurred while receiving the HTTP response)

    Increase the maxStringContentLength in the binding.

    Code:
    <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="Wmon.Basic.Binding"
              maxBufferSize="2147483647"
              maxReceivedMessageSize="2147483647">
              <readerQuotas maxDepth="32"
                maxStringContentLength="2147483647"
                maxArrayLength="16384"
                maxBytesPerRead="4096"
                maxNameTableCharCount="16384" />
            </binding>
          </basicHttpBinding>
        </bindings>
        <services>
          <service name="WmonEndpoint"
            behaviorConfiguration="Wmon.Basic.Behavior">
            <endpoint name="WmonEndpoint.Binding"
              ...
              binding="basicHttpBinding"
              bindingConfiguration="Wmon.Basic.Binding"
              ... />
            <host>
              <baseAddresses>
               <add baseAddress="http://localhost:5071/WmonEndpoint" />
              </baseAddresses>
            </host>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="Wmon.Basic.Behavior">
              <serviceMetadata httpGetEnabled="true" />
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
              <!-- <serviceDebug includeExceptionDetailInFaults="false"/> -->
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center