Response.Write problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steven Blair

    Response.Write problem

    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 ***
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Response.Write problem

    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]
    - mvp@spam.guard. caspershouse.co m

    "Steven Blair" <steven.blair@b tinternet.com> wrote in message
    news:u7PQG1qZFH A.2984@TK2MSFTN GP15.phx.gbl...[color=blue]
    > 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 ***[/color]


    Comment

    • Ignacio Machin \( .NET/ C# MVP \)

      #3
      Re: Response.Write problem

      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" <steven.blair@b tinternet.com> wrote in message
      news:u7PQG1qZFH A.2984@TK2MSFTN GP15.phx.gbl...[color=blue]
      > 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 ***[/color]


      Comment

      • Steven Blair

        #4
        Re: Response.Write problem

        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 ***

        Comment

        • Steven Blair

          #5
          Re: Response.Write problem

          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 ***

          Comment

          • Ignacio Machin \( .NET/ C# MVP \)

            #6
            Re: Response.Write problem

            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" <steven.blair@b tinternet.com> wrote in message
            news:%23wZmPwrZ FHA.2768@tk2msf tngp13.phx.gbl. ..[color=blue]
            > 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 ***[/color]


            Comment

            • Hans Kesting

              #7
              Re: Response.Write problem

              Steven Blair wrote:[color=blue]
              > 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
              >
              >[/color]

              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.publi c.dotnet.framew ork.aspnet

              Hans Kesting


              Comment

              • Steven Blair

                #8
                Re: Response.Write problem

                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_Session Id=<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 ***

                Comment

                Working...