By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,262 Members | 1,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,262 IT Pros & Developers. It's quick & easy.

Response.Write problem

P: n/a
Hi,

I am using C# and IIS for a application. I receive a request message,
process it then send a response back to my client. The problem I have,
when I call Response.Write the message sent to my client is a very large
message (I am guessing IIS adds it on).
Is there some way I send the data without all this addtional information
in it, perhaps a different approach to Response.Write ?

It looks like there is a lot of headers and IIS information add, version
numbers. It really does add a sever overheard to my application (I am
using GPRS and thats charge by the byte :| )

Any help on this would be appreciated.

Regards,

Steven

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Steven,

What else is on the page in addition to your code that is in the call to
Response.Write? Headers are part of the HTTP specification, you aren't
going to be able to send anything over HTTP without them.

Can you give an example of the output that is being sent to the client,
and then we can try and help you determine what to remove?

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Steven Blair" <st**********@btinternet.com> wrote in message
news:u7**************@TK2MSFTNGP15.phx.gbl...
Hi,

I am using C# and IIS for a application. I receive a request message,
process it then send a response back to my client. The problem I have,
when I call Response.Write the message sent to my client is a very large
message (I am guessing IIS adds it on).
Is there some way I send the data without all this addtional information
in it, perhaps a different approach to Response.Write ?

It looks like there is a lot of headers and IIS information add, version
numbers. It really does add a sever overheard to my application (I am
using GPRS and thats charge by the byte :| )

Any help on this would be appreciated.

Regards,

Steven

*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #2

P: n/a
Hi,

What client are you using?

This seems to be an app running on a PPC or a smartphone.

Unfortunally HTTP needs to send several header back anf forth so maybe you
will be better with a direct TCP connection

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Steven Blair" <st**********@btinternet.com> wrote in message
news:u7**************@TK2MSFTNGP15.phx.gbl...
Hi,

I am using C# and IIS for a application. I receive a request message,
process it then send a response back to my client. The problem I have,
when I call Response.Write the message sent to my client is a very large
message (I am guessing IIS adds it on).
Is there some way I send the data without all this addtional information
in it, perhaps a different approach to Response.Write ?

It looks like there is a lot of headers and IIS information add, version
numbers. It really does add a sever overheard to my application (I am
using GPRS and thats charge by the byte :| )

Any help on this would be appreciated.

Regards,

Steven

*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #3

P: n/a
Hi,

Thanks for the reply.

I think this is more to do with IIS, it looks like a xml / html message
with one of the tags holding the actual response message and various
strings with ASP.NET and IIS on it.

At the moment I can't get you the exact text returned as the POS we are
using is getting used for a demo, so cant get the debug information you
requested.

I am sure if I was just using straight http that the message would be
very small, but IIS adds a whole load of additional information.

I managed to reduce the message slightly byt turning off Custom HTTP
Headers (this removed 1 string from the response message, something like
"Powered by ASP.NET")

Any more help would appreciated.

Regards,

Steven

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #4

P: n/a
The client is a embedded device with a GPRS modem. IO understand the
need for some header information, but this is 500+ bytes of additional
information.

Hopefully this is is enough information for you guys to help me out. I
will try and get a debug capture of the response. Unless any of you guys
know how to get IIS to log any data it sends back?

Regards,

Steven

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #5

P: n/a
Hi,

The thing is if the client is expecting a HTTP connection it will need the
headers. maybe you can do an ISAPI to send only the minimun amount of info,
but I"m not very sure about that.
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Steven Blair" <st**********@btinternet.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
The client is a embedded device with a GPRS modem. IO understand the
need for some header information, but this is 500+ bytes of additional
information.

Hopefully this is is enough information for you guys to help me out. I
will try and get a debug capture of the response. Unless any of you guys
know how to get IIS to log any data it sends back?

Regards,

Steven

*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #6

P: n/a
Steven Blair wrote:
Hi,

I am using C# and IIS for a application. I receive a request message,
process it then send a response back to my client. The problem I have,
when I call Response.Write the message sent to my client is a very
large message (I am guessing IIS adds it on).
Is there some way I send the data without all this addtional
information in it, perhaps a different approach to Response.Write ?

It looks like there is a lot of headers and IIS information add,
version numbers. It really does add a sever overheard to my
application (I am using GPRS and thats charge by the byte :| )

Any help on this would be appreciated.

Regards,

Steven


Is this sent from an aspx file where you are getting the contents of that aspx
along with your code?
Either remove that code (if possible), or (in any case) start with Response.Clear
(you might also clear the headers), and end with Response.End. This should
remove a lot of "extra" code.

By the way, for asp.net specific questions (like this) there is a specific newsgroup:
microsoft.public.dotnet.framework.aspnet

Hans Kesting
Nov 17 '05 #7

P: n/a
Here is some of the response:

Date: Wed, 01 Jun, 2005 16:54:07 GMT

X-AspNet-Version: 1.1.4322

Set-Cookie: ASP.NET_SessionId=<string of chars>

Path=/

Cache-Control: private

Content-Type: text/html: charset=utf-8

Content-Length: 368

I have tried using a program called ServerMask and MS UrlScan (This
seemed to removed some of the data).

Sorry for posting in here, I dind't think to put it in a ASP.NET forum,
I was hoping I could resolve this issue with some C# code.

Regards,

Steven

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.