Response.Write problem

  • Thread starter Thread starter Steven Blair
  • Start date Start date
S

Steven Blair

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
 
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.
 
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,
 
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
 
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
 
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,
 
Steven said:
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
 
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
 
Back
Top