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

Text gets accumulates piecemeal before being sent to client. Now we use own class
Before I start explaining the code I will first give my use case so
A client is running my company's program and it is halting before it gets
I'm coding a simple websocket server on netty. Before a client connection has been
How can I garble JavaScript code before sending it to client-side? I don't want
Error that pops up even before anything else loads: Package Load Failure Package 'Microsoft.TeamFoundation.Client.ServicesHostPackage,
I am trying to prevent the client from disconnecting from the server. So before
I was hoping someone could validate my assumptions before I recommend that my client
I have a Django form that needs to do some client-side validation before submitting
I'm using a client - server app. When a client starts, he gets a

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.