Fog Creek Software
Discussion Board

MSXML 'Unspecified Error' Madness

Arrgh!!  Just trying to grab a file from a web server using basic HTTP authentication.

Response.Buffer = True
Dim objXMLHTTP, xml
Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")
getStr = "

xml.Open "GET", getStr, False,"username","password"                
Response.AddHeader "Content-Disposition","attachment;filename=somefile.gif

Response.AddHeader "Content-Length", 100
Response.ContentType = "application/octet-stream"                  
Response.BinaryWrite xml.responseBody
Response.Write xml.responseText
Set xml = Nothing

This fails every time with a useless:

msxml3.dll '80004005'
Unspecified error

The error number refers to:
Response.BinaryWrite xml.responseBody

But all that I've read on the issue seems to indicate the problem is the open method.  There is no proxy, and proxyconfg.exe won't even run.

I have googled, I have service packed, I have nearly plucked out my eyeballs! Help!!

Drederick Tatum
Thursday, February 26, 2004

At a very quick glance...
Remove the "Response.Write xml.responseText"
You shouldn't be doing both a BinaryWrite and a Write.

You should probably also drop the
Response.AddHeader ...
Response.ContentType ...
lines (or change the content type to "image/gif").

And you may need a
before the Response.BinaryWrite line (I'm not sure about this one).

Philip Dickerson
Thursday, February 26, 2004

Same Error.

Interesting to note that calling the send method causes IIS to hang.

Drederick Tatum
Thursday, February 26, 2004

if ($f = fopen("")) {
  while (!feof($f)) $sPage .= fgets($f, 32000);

oh wait... that's PHP.  Sorry, been reading the PHP vs. ASP.NET rant on Orkut for too long...

dir at badblue dot com
Thursday, February 26, 2004

This is truly ridiculous.

I have followed the Ms KB to the letter, I think I even managed to find a typo.

Microsoft's proxycfg tool will not run, and the instructions in the KB article make no sense and appear to be completely wrong.;en-us;829735

Drederick Tatum
Thursday, February 26, 2004

"Unspecified Error". Christ this annoys me. There must ALWAYS be more information available than this. What failed? Where? What information do you have about the failure?

In my .NET experience I can catch every exception by a try..catch at the top level.. Now I have two choices.. I can output "Some strange shit happened" or I can output "Some strange shit happened, details: " & ex.ToString

Whatever code you write either gets back information from whatever it called or knows what it was trying to do and why it failed.

If the best you can do is "unspecified error" then you're a fuckwit (sorry Micrsoft and a zillion others but it's true).

The only mitigation is if the component you call doesn't provide adequate feedback but in the instance you're quoting? sounds like Microsoft calling Microsoft to me so no excuse.

Thursday, February 26, 2004

Um... a GET request can't have a body, so MSXML is erroring out when you try to add one.

Mind you, it's not a very helpful error, there may be some other place you can look for more details (e.g. xml.errorsomething) that I don't know of.

If you want to PUT a file, use the PUT verb.

Thursday, February 26, 2004

No, I'm getting a binary file  and dumping it to the browser.

I finally got it to work.  The issue was incompatible versions of the MSXML library.  v4 would not, but v3 would - using code samples straight from the SDK. 

Also, can someone please explain why in the name of all that is holy an XM L library installation requires a reboot?  IT PARSES TEXT FILES!!!

Isn't this what they call DLL hell?

Drederick Tatum
Thursday, February 26, 2004

*  Recent Topics

*  Fog Creek Home