Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1075709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:18:43+00:00 2026-05-16T21:18:43+00:00

I have been tasked to look after an ASP.Net WebForms application that communicates with

  • 0

I have been tasked to look after an ASP.Net WebForms application that communicates with a WCF service hosted by a Windows service. The binding used for the service is netTcpBinding.

The service exposes methods to Upload and Download ‘files’. The user select to upload a file and the HttpPostFile.InputSteam is passed directly to the service as a parameter in the service ‘Upload’ method. The service saves the stream as a byte array to the database [database field data type is varbinary (max)].

The file download data flow is essentially the reverse process. The bytes are retrieved from the database; loaded into a MemoryStream in the WCF service; and then returned to the Web Application.

I have captured the data contained in the streams (sent / received) at each step in the above operations – on the client (web app) and the service. I have looped through and written out to a flat file the bytes contained in each stream.

The byte array in each case is identical [byte value; and number of bytes in the stream] except for the File Download operation. At the point where the stream is returned to the Web Application from the WCF service. Here the number of bytes received is correct but only the first 255 bytes are populated. The values of the remaining bytes are zero

I have made a host of experimental changes to the binding values – in both the client at service – as I believe that the problem must lie here. To date I have not influenced the status of the bytes returned in any way. The logs for the Client and service do not show any that any exceptions are thrown or any other problems.

I do not have much experience in setting the correct combinations of binding (and other configuration) attributes for Client and Server applications – having relied on defaults in the past. We need the service and client to be configured to transfer the maximum allowable file size. Unfortunately I cannot use MTOM.

This post and links, did not offer me any insight. So far I have found no other information that helps.

Hopefully someone can assist me with what the issue might be. Below are the bindings that I am using:

Client [web.config]:

  <bindings>  
         <netTcpBinding>
            <binding name="TCP"  
                       closeTimeout="00:01:00" 
                       openTimeout="00:10:00"
                       receiveTimeout="00:01:00" sendTimeout="00:01:00" 
                       transferMode="Streamed" 
                       maxBufferPoolSize="512"
                       maxBufferSize="2147483647" 
                       maxConnections="10" 
                       maxReceivedMessageSize="2147483647">     

               <readerQuotas maxDepth="32" 
                             maxStringContentLength="2147483647" 
                             maxArrayLength="2147483647"
                             maxBytesPerRead="4096" 
                             maxNameTableCharCount="2147483647" />
               <reliableSession ordered="true" inactivityTimeout="00:10:00"
                 enabled="false" />
               <security mode="Transport">
                  <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
                  <message clientCredentialType="Windows" />
               </security>
            </binding>
         </netTcpBinding>

Service:

<netTcpBinding>
        <binding name="netTCP"
                 closeTimeout="00:01:00"
                 openTimeout="00:01:00"
                 receiveTimeout="00:01:00" sendTimeout="00:01:00"
                 transferMode="Streamed"
                 listenBacklog="30"
                 maxBufferPoolSize="512"
                 maxBufferSize="2147483647"
                 maxConnections="30"
                 maxReceivedMessageSize="2147483647"
                 portSharingEnabled="true">
          <readerQuotas maxDepth="32"
                        maxStringContentLength="2147483647"
                        maxArrayLength="2147483647"
                        maxBytesPerRead="4096"
                        maxNameTableCharCount="2147483647" />
        </binding>
      </netTcpBinding>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T21:18:44+00:00Added an answer on May 16, 2026 at 9:18 pm

    Silly me. I think I have got it.

    The bindings were OK. I was not dealing with reading the bytes correctly from the stream into the buffer on the client.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.