preload - Is there a built-in way to determine the size of a WCF response? -
before client gets full payload of web request, we'd first send measurement of size of response get. if response large, client present message user giving them option abort operation.
we can write custom code preload response on server, determine size, , pass on client, we'd rather not if there's way it.
does know if wcf has tricky way this? or there free third party tools out there accomplish this?
thanks.
i don't think there's "tricky" in wcf or .net framework this, really. passing client? instance of class?
what run query or fetch response, , serialize memory stream , see how big gets. won't totally accurate size - soap messages has overhead it, soap envelope , headers , stuff - can give ballpark figure of whether you're return few hundred bytes, or couple megabytes.
trouble is: might take while on server assemble / query, , "measure", too. plus you'd have have 2 calls - 1 "measureresult" returns int or long or something, , second call "getresult" results. you'll incur effort assemble message twice....
i don't have answer you, maybe need figure out other way allow client abort call if takes long. or find way more figure out indicator how large response (without getting details of response itself).
Comments
Post a Comment