By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,732 Members | 1,429 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,732 IT Pros & Developers. It's quick & easy.

win32com.client.Dispatch - understanding error messages

P: n/a
O/S : Win2K
vsn of Python: 2.4

Hoping to find information that provide information about error
messages being encountered.

Pythonwin session:
>>import win32com.client
blah = win32com.client.Dispatch('MSXML2.XMLHTTP')
blah.open("POST", "12.5.81.49/crg_cbsil_vtest_52/crg.aspx", 0)
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "<COMObject MSXML2.XMLHTTP>", line 4, in open
com_error: (-2147352567, 'Exception occurred.', (0, None, None, None,
0, -2147467259), None)

I tried various combinations in Google involving
"win32com.client.Dispatch", "MSXML2", "XMLHTTP" and the 2 different
error codes: -2147352567 and -2147467259. So far, I haven't been able
to locate anything that has helped me zero in on the error.

The fact that no error was issued after the blah = ... statement plus
the fact that as soon as I typed the '(' character after blah.open,
that the arguments for the open method were displayed; those two things
make me think that the COM object is installed/registered on the
workstation. Is that a reasonable conclusion?

I observed that there are a few other similarly named objects/methods,
so I tried them as well. The error messages reference some different
dll's, but those error message seemed as inscrutable as the first set
of error messages above.
>>blah = win32com.client.Dispatch('MSXML2.XMLHTTP.4.0')
blah.open("POST", "12.5.81.49/crg_cbsil_vtest_52/crg.aspx", 0)
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "<COMObject MSXML2.XMLHTTP.4.0>", line 4, in open
com_error: (-2147352567, 'Exception occurred.', (0, 'msxml4.dll',
'System error: -2147012890.\r\n', None, 0, -2147012890), None)

and
>>blah = win32com.client.Dispatch('MSXML2.ServerXMLHTTP')
blah.open("POST", "12.5.81.49/crg_cbsil_vtest_52/crg.aspx", 0)
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "<COMObject MSXML2.ServerXMLHTTP>", line 4, in open
com_error: (-2147352567, 'Exception occurred.', (0, 'msxml3.dll',
'Unspecified error\r\n', None, 0, -2147467259), None)

Also tried varying the 3rd argument...instead of using 0 to represent
False, I tried:
>>False
False
>>blah = win32com.client.Dispatch('MSXML2.XMLHTTP')
blah.open("POST", "12.5.81.49/crg_cbsil_vtest_52/crg.aspx", False)
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "<COMObject MSXML2.XMLHTTP>", line 4, in open
com_error: (-2147352567, 'Exception occurred.', (0, None, None, None,
0, -2147467259), None)

So, if possible, it would be nice to know two different types of
things:
1) what steps to take to correct these errors
2) where one can locate information about these types of errors

Jul 18 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
wrote:
>>>False
False
>>>blah = win32com.client.Dispatch('MSXML2.XMLHTTP')
blah.open("POST", "12.5.81.49/crg_cbsil_vtest_52/crg.aspx", False)
Does using an absolute URL for the url parameter help any? You've specified
a relative URL (i.e. the folder 12.5.81.49 under the current location).

Jul 18 '06 #2

P: n/a
Duncan Booth wrote:
wrote:

Does using an absolute URL for the url parameter help any? You've specified
a relative URL (i.e. the folder 12.5.81.49 under the current location).
I don't know the answer to that question. I know that when I'm on the
same workstation and I copy/paste the string that is the url parameter
into my browser and press Enter, that a reply appears within the
browser, and that reply has content that suggests that the browser app
was able to 'talk' to an application on the other end. The error
message being received in reply to the open method make me think that
the open method wasn't able to talk to any app on the other end. I'm
not sure what can be inferred from that observation other than the url
parameter appears to be valid when it is used in a browser application.

Jul 18 '06 #3

P: n/a
mi************@yahoo.com wrote:
Duncan Booth wrote:
>wrote:

Does using an absolute URL for the url parameter help any? You've
specified a relative URL (i.e. the folder 12.5.81.49 under the
current location).

I don't know the answer to that question. I know that when I'm on the
same workstation and I copy/paste the string that is the url parameter
into my browser and press Enter, that a reply appears within the
browser, and that reply has content that suggests that the browser app
was able to 'talk' to an application on the other end. The error
message being received in reply to the open method make me think that
the open method wasn't able to talk to any app on the other end. I'm
not sure what can be inferred from that observation other than the url
parameter appears to be valid when it is used in a browser
application.
Are you really sure that the browser isn't making guesses about what you
meant and correcting the error for you? Does what remains in the address
bar when the page is retrieved really match *exactly* what you copied and
pasted?
Jul 18 '06 #4

P: n/a

Duncan Booth wrote:
Are you really sure that the browser isn't making guesses about what you
meant and correcting the error for you? Does what remains in the address
bar when the page is retrieved really match *exactly* what you copied and
pasted?
Thank you for that pointer. The answer is: no, it does not match
exactly. The browser did indeed, as you surmised, make a guess and
correct the error. The browser added 'http://' to the beginning. When
'http://' gets added to the beginning of the url parameter, all is well.

Jul 19 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.