Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Specifying HTTP/1.0 with ServerXmlHttp

Reply
Thread Tools

Specifying HTTP/1.0 with ServerXmlHttp

 
 
BenArk
Guest
Posts: n/a
 
      03-06-2009
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.
 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      03-10-2009

"BenArk" <> wrote in message
news:CE99ED60-9F47-4A29-89A8-...
>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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MSXML2.ServerXMLHTTP to HttpWebRequest: Error 500 Maris Janis Vasilevskis ASP .Net 2 08-29-2005 08:03 PM
.NET version of ServerXMLHTTP? David ASP .Net 2 11-30-2004 10:32 AM
HttpWebRequest taking lot more than ServerXmlHTTP anshu ASP .Net 0 09-13-2004 12:37 PM
if in asp is CreateObject("Microsoft.XMLHTTP"). Is in asp.net this Server.CreateObject("MSXML2.ServerXMLHTTP") ? Raúl Martín ASP .Net 1 05-13-2004 03:47 AM
retrieving PDF file with ServerXMLHTTP object =?Utf-8?B?QnJpYW4gQmFybmV0dA==?= ASP .Net 1 02-15-2004 01:06 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57