Specifying HTTP/1.0 with ServerXmlHttp

B

BenArk

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.
 
A

Anthony Jones

BenArk said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top