Specifying HTTP/1.0 with ServerXmlHttp

Discussion in 'ASP General' started by BenArk, Mar 6, 2009.

  1. BenArk

    BenArk Guest

    I am working with a legacy ASP web app that uses the MSXML2.ServerXMLHTTP.6.0
    COM object to post data to another web server. The page that does this was
    working very nicely for several years. The organization we are posting to has
    recently made changes to their system and we are now required to post to a
    new server.

    The new server seems to be behind a Citrix NetScaler load balancing
    appliance. Either the ServerXmlHttp object or this appliance are doing a poor
    job of handling HTTP/1.1 KeepAlive requests.

    By default, the v4+ of the ServerXmlHttp object is making HTTP 1.1 requests
    which are being kept alive for a while and are eventually closed by this new
    server (or the NetScaler appliance). If this happens during a request, the
    following error is returned by the ServerXmlHttp object:

    msxml6.dll error '80072efe'
    The connection with the server was terminated abnormally

    In an attempt to force the connection to close rather than KeepAlive, I have
    tried setting the Connection header to "close" like so:

    set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
    xmlhttp.setTimeouts 0, 60000, 120000, 120000
    xmlhttp.open "POST", sPostUrl, False, sLogin, sPassword
    xmlhttp.setRequestHeader "Connection", "close"
    xmlhttp.send sPostXml
    sResultXml = xmlhttp.responseText

    The "terminated abnormally" error is ALWAYS returned when the Connection
    header is set to "close."

    We have tested this using the WinHttpRequest object in an ASP.NET
    implementation and encountered the same error. In .NET, our salivation was
    setting the HttpWebRequest.KeepAlive to false and the ProtocolVersion to
    HttpVersion.Version10.

    I have searched for hours and cannot find a way to force the ServerXmlHttp
    to do something similar. Is there any way to force it to submit the request
    as HTTP/1.0 and turn off keep-alives?

    I realize the ideal solution would be to deploy our ASP.NET implementation
    or "fix" this new server but neither of those are viable options right now.

    Any guidance or assistance will be greatly appreciated.
     
    BenArk, Mar 6, 2009
    #1
    1. Advertising

  2. "BenArk" <> wrote in message
    news:...
    >I am working with a legacy ASP web app that uses the
    >MSXML2.ServerXMLHTTP.6.0
    > COM object to post data to another web server. The page that does this was
    > working very nicely for several years. The organization we are posting to
    > has
    > recently made changes to their system and we are now required to post to a
    > new server.
    >
    > The new server seems to be behind a Citrix NetScaler load balancing
    > appliance. Either the ServerXmlHttp object or this appliance are doing a
    > poor
    > job of handling HTTP/1.1 KeepAlive requests.
    >
    > By default, the v4+ of the ServerXmlHttp object is making HTTP 1.1
    > requests
    > which are being kept alive for a while and are eventually closed by this
    > new
    > server (or the NetScaler appliance). If this happens during a request, the
    > following error is returned by the ServerXmlHttp object:
    >
    > msxml6.dll error '80072efe'
    > The connection with the server was terminated abnormally
    >
    > In an attempt to force the connection to close rather than KeepAlive, I
    > have
    > tried setting the Connection header to "close" like so:
    >
    > set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
    > xmlhttp.setTimeouts 0, 60000, 120000, 120000
    > xmlhttp.open "POST", sPostUrl, False, sLogin, sPassword
    > xmlhttp.setRequestHeader "Connection", "close"
    > xmlhttp.send sPostXml
    > sResultXml = xmlhttp.responseText
    >
    > The "terminated abnormally" error is ALWAYS returned when the Connection
    > header is set to "close."
    >
    > We have tested this using the WinHttpRequest object in an ASP.NET
    > implementation and encountered the same error. In .NET, our salivation was
    > setting the HttpWebRequest.KeepAlive to false and the ProtocolVersion to
    > HttpVersion.Version10.
    >
    > I have searched for hours and cannot find a way to force the ServerXmlHttp
    > to do something similar. Is there any way to force it to submit the
    > request
    > as HTTP/1.0 and turn off keep-alives?
    >
    > I realize the ideal solution would be to deploy our ASP.NET implementation
    > or "fix" this new server but neither of those are viable options right
    > now.
    >
    > Any guidance or assistance will be greatly appreciated.



    Use the WinHttpRequest instead:-


    Const WinHttpRequestOption_EnableHttp1_1 = 17

    Dim oWinHTTP
    Dim oStream

    Set oWinHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
    oWinHTTP.SetTimeouts 0, 60000, 120000, 120000
    oWinHTTP.Option(WinHttpRequestOption_EnableHttp1_1) = False

    oWinHTTP.Open "POST", sPostUrl, False, sLogin, sPassword
    oWinHTTP.Send

    sResult = oWinHTTP.ResponseText



    I would strongly recommend you find get a copy of
    http://www.fiddlertool.com/fiddler and observe the convesation between your
    code and the server, it seems likely that the server is mis-behaving and its
    worth infoming the server owners of that.




    --
    Anthony Jones - MVP ASP/ASP.NET
     
    Anthony Jones, Mar 10, 2009
    #2
    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. =?Utf-8?B?QnJpYW4gQmFybmV0dA==?=

    retrieving PDF file with ServerXMLHTTP object

    =?Utf-8?B?QnJpYW4gQmFybmV0dA==?=, Feb 14, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,235
    =?Utf-8?B?QnJpYW4gQmFybmV0dA==?=
    Feb 15, 2004
  2. anshu
    Replies:
    0
    Views:
    412
    anshu
    Sep 13, 2004
  3. David

    .NET version of ServerXMLHTTP?

    David, Nov 30, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    4,824
    David
    Nov 30, 2004
  4. Maris Janis Vasilevskis

    MSXML2.ServerXMLHTTP to HttpWebRequest: Error 500

    Maris Janis Vasilevskis, Aug 29, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    6,446
    Maris Janis Vasilevskis
    Aug 29, 2005
  5. Andrew Parlane
    Replies:
    11
    Views:
    215
    Andrew Parlane
    Aug 29, 2008
Loading...

Share This Page