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.

About Gaston

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s