Menu

#216 Minidom bug in ParsedSoap: Default namespace is empty

v2.1
open
nobody
zsi (169)
5
2007-10-10
2007-10-10
Jussi Kuosa
No

To quote Josh:
"""
Basically anyType couldn't find a typecode, so it ends up parsing it as a dict. For some reason it seems "anyType" typecode is failing to grab the "VirtualMachineSnapshotInfo" type.

I put a couple print statements in TC.AnyType.parse and discovered that it's most likely a XML DOM bug. Basically this is happening because I replaced PyXML with minidom in as the default readerclass in "ParsedSoap".

You could confirm this by simply replacing "ParsedSoap.py" with the
old version.
"""

This was actually zsi\ZSI\parse.py

"""
If I'm right, please file a bug report on this titled "Minidom bug in ParsedSoap: Default namespace is empty". This is good to know, I thought there were a few problems with minidom.
"""

Here you go :-)

I've attached the original information file for reference.

Discussion

  • Jussi Kuosa

    Jussi Kuosa - 2007-10-10

    WSDL iteration

     
  • Jussi Kuosa

    Jussi Kuosa - 2007-10-10

    Logged In: YES
    user_id=398235
    Originator: YES

    Oops, forgot to add the response that gave me headaches:

    """
    Hi,
    I tried to understand what goes wrong and it seems the anyType
    handling works somehow differently in 1419 than in 1400.

    The response is:
    ...
    <RetrievePropertiesResponse xmlns="urn:vim2">
    <returnval>
    <obj type="VirtualMachine">208</obj>
    <propSet>
    <name>snapshot</name>
    <val xsi:type="VirtualMachineSnapshotInfo">
    <currentSnapshot
    type="VirtualMachineSnapshot">/vmfs...apshot-8</currentSnapshot>
    <rootSnapshotList>
    <snapshot type="VirtualMachineSnapshot">/vmfs...apshot-1</snapshot>
    <vm type="VirtualMachine">208</vm>
    <name>psprunner</name>
    <description></description>
    <createTime>2007-01-12T13:48:58.441926+02:00</createTime>
    <state>poweredOn</state>
    <quiesced>false</quiesced>
    <childSnapshotList>
    ...

    Previously I got the rootSnapshotList with
    return resp.ReturnVal[0].PropSet[0].Val.RootSnapshotList
    now I can only get the dict version with ...Val['rootSnapshotList'].
    Everything works as before until I get to the val xsi:anyType element.

    However, I want to iterate the snapshots and previously I've used:
    for snapshot in rootSnapshotList: ...
    and I want to return the snapshot for inclusion to
    RevertToSnapshot_TaskRequestMsg():
    req._this = snapshotMORef

    Can anyone help me in figuring out how to change my (previously
    working) code to work with 1419? I've attached the relevant WSDL bits,
    please see my earlier post for the full WSDLs.
    """

     

Log in to post a comment.