Calculate content-length

Discussion in 'ASP .Net Web Services' started by kackson, Apr 26, 2004.

  1. kackson

    kackson Guest

    Hi.
    Before I POST my soap message, I need to fill out the Content-Length
    for my content to tbe sent over. For the case below:

    POST /SoapExamples/simpleService.asmx HTTP/1.1
    Host: localhost
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "urn:schemas-syngress-com-soap/echo"

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <echo xmlns="urn:schemas-syngress-com-soap">
    <input>string</input>
    </echo>
    </soap:Body>
    </soap:Envelope>

    what is my content length? How do you calculate it? I dont seems to be
    able to get the right content length. Are there also tools/scripts to
    calculte the content legnth? Thank you.
    kackson, Apr 26, 2004
    #1
    1. Advertising

  2. kackson

    Jan Tielens Guest

    The content length is part of the http protocol. Do you really want to send
    a soap message so "low level"? If you do it the easy way you don't have to
    worry about it!

    --
    Greetz,
    Jan
    ________________________
    Read my weblog: http://weblogs.asp.net/jan

    "kackson" <> schreef in bericht
    news:...
    > Hi.
    > Before I POST my soap message, I need to fill out the Content-Length
    > for my content to tbe sent over. For the case below:
    >
    > POST /SoapExamples/simpleService.asmx HTTP/1.1
    > Host: localhost
    > Content-Type: text/xml; charset=utf-8
    > Content-Length: length
    > SOAPAction: "urn:schemas-syngress-com-soap/echo"
    >
    > <?xml version="1.0" encoding="utf-8"?>
    > <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    > <soap:Body>
    > <echo xmlns="urn:schemas-syngress-com-soap">
    > <input>string</input>
    > </echo>
    > </soap:Body>
    > </soap:Envelope>
    >
    > what is my content length? How do you calculate it? I dont seems to be
    > able to get the right content length. Are there also tools/scripts to
    > calculte the content legnth? Thank you.
    Jan Tielens, Apr 26, 2004
    #2
    1. Advertising

  3. kackson

    kackson Guest

    Yes. I really do need to take care of this low level stuff because I'm
    tasked to write a simple http client with a tight deadline and thus
    little time to read through all those low level details of http.
    So, for my first message, what should be the Content length?
    Thanks!!

    "Jan Tielens" <> wrote in message news:<#>...
    > The content length is part of the http protocol. Do you really want to send
    > a soap message so "low level"? If you do it the easy way you don't have to
    > worry about it!
    >
    > --
    > Greetz,
    > Jan
    > ________________________
    kackson, Apr 26, 2004
    #3
  4. kackson

    Jan Tielens Guest

    Ic, I should take a look at the HTML RFC's:
    http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html
    Section 4.4

    --
    Greetz,
    Jan
    ________________________
    Read my weblog: http://weblogs.asp.net/jan

    "kackson" <> schreef in bericht
    news:...
    > Yes. I really do need to take care of this low level stuff because I'm
    > tasked to write a simple http client with a tight deadline and thus
    > little time to read through all those low level details of http.
    > So, for my first message, what should be the Content length?
    > Thanks!!
    >
    > "Jan Tielens" <> wrote in message

    news:<#>...
    > > The content length is part of the http protocol. Do you really want to

    send
    > > a soap message so "low level"? If you do it the easy way you don't have

    to
    > > worry about it!
    > >
    > > --
    > > Greetz,
    > > Jan
    > > ________________________
    Jan Tielens, Apr 26, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mitchua
    Replies:
    5
    Views:
    2,715
    Eric J. Roode
    Jul 17, 2003
  2. =?Utf-8?B?SG96aQ==?=
    Replies:
    1
    Views:
    6,937
    Ken Cox [Microsoft MVP]
    Jun 2, 2004
  3. hazz
    Replies:
    6
    Views:
    49,413
    SkyUCHC
    Jun 9, 2010
  4. Angus
    Replies:
    13
    Views:
    674
    CBFalconer
    Jan 5, 2007
  5. Michael
    Replies:
    5
    Views:
    162
    Michael
    Mar 15, 2007
Loading...

Share This Page