win32com.client.Dispatch - understanding error messages

Discussion in 'Python' started by mirandacascade@yahoo.com, Jul 18, 2006.

  1. Guest

    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, 2006
    #1
    1. Advertising

  2. Duncan Booth Guest

    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).
     
    Duncan Booth, Jul 18, 2006
    #2
    1. Advertising

  3. Guest

    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, 2006
    #3
  4. Duncan Booth Guest

    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?
     
    Duncan Booth, Jul 18, 2006
    #4
  5. Guest

    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, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stefano Masini
    Replies:
    2
    Views:
    1,267
    Markus Wankus
    Mar 6, 2004
  2. selwyn
    Replies:
    0
    Views:
    511
    selwyn
    Jul 1, 2004
  3. Tim Golden
    Replies:
    0
    Views:
    679
    Tim Golden
    Jul 16, 2004
  4. Shawn Wheatley
    Replies:
    0
    Views:
    594
    Shawn Wheatley
    Jul 16, 2004
  5. Replies:
    2
    Views:
    1,299
Loading...

Share This Page