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 763355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:32:51+00:00 2026-05-14T16:32:51+00:00

Before a client gets the full payload of the web request, we’d like to

  • 0

Before a client gets the full payload of the web request, we’d like to first send it a measurement of the size of the response it will get. If the response will be too large, the client will present a message to the user giving them the option to abort the operation.

We can write some custom code to preload the response on the server, determine the size, and then pass it on to the client, but we’d rather not if there’s another way to do it.

Does anyone know if WCF has any tricky way to do this? Or are there any free third party tools out there that will accomplish this?

Thanks.

  • 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-14T16:32:52+00:00Added an answer on May 14, 2026 at 4:32 pm

    I don’t think there’s anything “tricky” in WCF or the .NET framework to do this, really. What are you passing back to the client? An instance of a class?

    What you could do is run the query or however you fetch the response, and then serialize that into a memory stream and see how big it gets. This won’t be a totally accurate size – the SOAP messages has some overhead to it, like SOAP envelope and headers and stuff – but it can give you a ballpark figure of whether you’re about to return a few hundred bytes, or a couple megabytes.

    Trouble is: this might take a while on the server just to assemble / query, and then to actually “measure”, too. Plus you’d almost have to have two calls – one to “MeasureResult” which returns an Int or Long or something, and then a second call “GetResult” to actually get the results. So you’ll incur that effort to assemble the message twice….

    I don’t really have a good answer for you, but maybe you just need to figure out some other way to allow the client to abort a call if it takes too long. Or find a way to more quickly figure out an indicator as to how large the response will be (without getting all the details of the response itself).

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

Sidebar

Related Questions

I am using WCF as a client for a java web service. I have
I have found a situation where a WCF client can crash a WCF ServiceHost
My android application needs another NATIVE application executable to run before the android one,
I have a function, that gets a large XML file, then parses it, and
It's a pretty standard setup, WinForms client > Self-serving Business/Data layer > SQL Server
I want to select the first row in a table, order by time (ascending),
I just ventured into writing my first socket based programs in Delphi 2010. I
I'm in a bit of trouble here. I upgraded one of our Winforms products
I am writing a global hook DLL that needs to do some drawing using
I'm trying to track down an issue on an ASP.NET v3.5 application where the

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.