Receiving a long response (> 64kb) from a web service (WCF client)

Tags van Technorati:

 

I’m calling a web service which returns (after a long while) a large string. This string is more than 64 KB in size, so I had to tweak the config file on the client. Here are the highlighted changes in the app.config file:

<basicHttpBinding>
  <binding name="VLSAdminSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
    receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false"
    bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="655360"
    messageEncoding="Text" textEncoding="utf-8" transferMode="StreamedResponse"
    useDefaultWebProxy="true">
    <readerQuotas maxDepth="32" maxStringContentLength="81920" maxArrayLength="16384"
      maxBytesPerRead="4096" maxNameTableCharCount="16384" />

 

The maxReceivedMessageSize is by default 65536, I made this 655360. I also specified that the response isn’t buffered, but that it will be streamed. I also had to increase the maxStringContentLength.

Also notice that the sendTimeout thas been put to 10 minutes, because the service doesn’t return anything soon.

Unknown's avatar

About Gaston

MCT, MCSD, MCDBA, MCSE, MS Specialist
This entry was posted in Geen categorie. Bookmark the permalink.

Leave a comment