Discussion:
Solution to XMLHTTP error 800c0008 (-2148270088) in requesting XML over HTTPS
(too old to reply)
r***@gmail.com
2007-09-27 17:00:18 UTC
Permalink
I didn't find a clear solution to this error in any posts, so here it
is FYI...hope it saves the reader some headaches!

Problem:
Server-to-server XML using the XMLHTTP object requesting XML from a
secure SSL (HTTPS) page, throws error 800c0008 (-2148270088) and the
message: "The download of the specified resource has failed."

Solution:
Use the "Msxml2.ServerXMLHTTP" object instead of the regular "XMLHTTP"
object. For some reason the regular object works server-to-server over
HTTP, but when using HTTPS, only the ServerXMLHTTP object will work.

Reason, according to MSDN:
"The only supported method for making HTTP requests from server-side
ASP script is if you use ServerXMLHTTP object (MSXML2.ServerXMLHTTP)
that is provided with XML 3.0 or later." (http://support.microsoft.com/
kb/237906)

See the ServerXMLHTTP Reference here: http://msdn2.microsoft.com/en-us/library/ms754586.aspx

Note: If the XML you are requesting has an XML declaration, make sure
that declaration is the first thing in the response (i.e. no empty
lines before it), otherwise ServerXMLHTTP will be not be able to
populate "responseXML" (but it will be able to populate
"responseText").

~Ricky
Anthony Jones
2007-10-02 09:15:42 UTC
Permalink
Post by r***@gmail.com
I didn't find a clear solution to this error in any posts, so here it
is FYI...hope it saves the reader some headaches!
Server-to-server XML using the XMLHTTP object requesting XML from a
secure SSL (HTTPS) page, throws error 800c0008 (-2148270088) and the
message: "The download of the specified resource has failed."
Use the "Msxml2.ServerXMLHTTP" object instead of the regular "XMLHTTP"
object. For some reason the regular object works server-to-server over
HTTP, but when using HTTPS, only the ServerXMLHTTP object will work.
"The only supported method for making HTTP requests from server-side
ASP script is if you use ServerXMLHTTP object (MSXML2.ServerXMLHTTP)
that is provided with XML 3.0 or later." (http://support.microsoft.com/
kb/237906)
http://msdn2.microsoft.com/en-us/library/ms754586.aspx
Post by r***@gmail.com
Note: If the XML you are requesting has an XML declaration, make sure
that declaration is the first thing in the response (i.e. no empty
lines before it), otherwise ServerXMLHTTP will be not be able to
populate "responseXML" (but it will be able to populate
"responseText").
ResponseXML will have a parseError. Strictly speaking the xml specification
indicates that the declaration should not be preceeded by anything and that
includes whitespace. Older implementations of msxml (pre version 3) were
more permissive and allowed whitespace before the declare.

With MSXML DOM instances created using progIDs such as Microsoft.XMLDOM and
MSXML2.DOMDocument or their CLSID equivalents implement a Load method that
is tolerant of the whitespace. Using the more specific ProgID
MSXML3.DOMDocument.3.0 would result in a DOM instance whose load method
would apply the XML standard more strictly. It is an instance of this DOM
that ServerXMLHTTP exposes.

It should also be noted that a server sending XML content to be loaded in
this way must specify the content-type as an xml type such as "text/xml".
If not ServerXMLHTTP won't even attempt to load the DOM.
--
Anthony Jones - MVP ASP/ASP.NET
Pradeep Gururani
2007-10-09 14:02:44 UTC
Permalink
This post might be inappropriate. Click to display it.
Anthony Jones
2007-10-10 09:00:08 UTC
Permalink
Post by Pradeep Gururani
Post by r***@gmail.com
Post by r***@gmail.com
I didn't find a clear solution to this error in any posts, so here it
is FYI...hope it saves the reader some headaches!
Server-to-server XML using the XMLHTTP object requesting XML from a
secure SSL (HTTPS) page, throws error 800c0008 (-2148270088) and the
message: "The download of the specified resource has failed."
Use the "Msxml2.ServerXMLHTTP" object instead of the regular "XMLHTTP"
object. For some reason the regular object works server-to-server over
HTTP, but when using HTTPS, only the ServerXMLHTTP object will work.
"The only supported method for making HTTP requests from server-side
ASP script is if you use ServerXMLHTTP object (MSXML2.ServerXMLHTTP)
that is provided with XML 3.0 or later."
(http://support.microsoft.com/
Post by Pradeep Gururani
Post by r***@gmail.com
Post by r***@gmail.com
kb/237906)
http://msdn2.microsoft.com/en-us/library/ms754586.aspx
Post by r***@gmail.com
Note: If the XML you are requesting has an XML declaration, make sure
that declaration is the first thing in the response (i.e. no empty
lines before it), otherwise ServerXMLHTTP will be not be able to
populate "responseXML" (but it will be able to populate
"responseText").
ResponseXML will have a parseError. Strictly speaking the xml specification
indicates that the declaration should not be preceeded by anything and that
includes whitespace. Older implementations of msxml (pre version 3) were
more permissive and allowed whitespace before the declare.
With MSXML DOM instances created using progIDs such as Microsoft.XMLDOM and
MSXML2.DOMDocument or their CLSID equivalents implement a Load method that
is tolerant of the whitespace. Using the more specific ProgID
MSXML3.DOMDocument.3.0 would result in a DOM instance whose load method
would apply the XML standard more strictly. It is an instance of this DOM
that ServerXMLHTTP exposes.
It should also be noted that a server sending XML content to be loaded in
this way must specify the content-type as an xml type such as "text/xml".
If not ServerXMLHTTP won't even attempt to load the DOM.
--
Anthony Jones - MVP ASP/ASP.NET- Hide quoted text -
- Show quoted text -
I was also getting the same error when I was using "Microsoft.XMLDOM"
object. It was not able to work over the SSL. Then based on the
solution suggested here I tried to create the object of
"Msxml2.ServerXMLHTTP.3.0". But IE 7 did not allow me to create the
object of this ActiveX control due to security constraint, though I
had marked my site as trusted site.
Then I poked inside https://mail.google.com. They were able to happily
live with Msxml2.XmlHTTP object over the SSL layer. I decided to give
it a try and it started working. So guys FYI, Msxml2.XMLHTTP works
over SSL. I am using it successfully.
It does in the client environment such as in IE6/7 and XMLHTTP is the
appropriate object (in IE7 you use the builtin XmlHttpRequest object also)
but you should use ServerXMLHTTP for server-to-server conversations.

I'm surprised the creation of ServerXMLHTTP object failed in IE7. I can
imagine a number of reasons why it wouldn't work but I didn't think that
creating it would be a problem.
--
Anthony Jones - MVP ASP/ASP.NET
Loading...