From: Luca C. <lcl...@uc...> - 2009-04-23 19:06:11
|
Peter Åstrand wrote: >> The parsing routines fail to find the correct typecode, this is the same >> issue but go ahead and make out a bug report and I'll fix it. Seems like >> there needs to be a general solution. > > I forgot to say, but I reported the bug some while ago, see > http://sourceforge.net/tracker/?func=detail&aid=2762639&group_id=26590&atid=387667 > . Any chance someone could take a look at it in the near future? We need > to have this working within 1 week, otherwise we'll need to use the > painfully slow 2.0. > > I can see that Donations are not activated, but since this is so important > to us, we will offer a $200 bounty to the person or team that solves these > problems so that 2.1a1 works with VMware. The condition is that the fix > must be available before monday, ie within one week. > > Best regards, > Peter Åstrand > Hey Peter, can you send us an entire message, and maybe also the WSDL, that would help us to debug it. I guess the best is if you upload it in your bug report: https://sourceforge.net/tracker/?func=detail&aid=2762639&group_id=26590&atid=387667 Luca >>> Hi again, thanks for looking into this. I've tried the latest SVN >>> versionnow. The original problems is gone, but instead I get another >>> traceback: >>> >>> ... >>> File "/opt/foo/modules/ZSI/client.py", line 544, in Receive >>> return _Binding.Receive(self, replytype, **kw) >>> File "/opt/foo/modules/ZSI/client.py", line 469, in Receive >>> reply = self.ps.Parse(tc) >>> File "/opt/foo/modules/ZSI/parse.py", line 326, in Parse >>> return how.parse(self.body_root, self) >>> File "/opt/foo/modules/ZSI/TCcompound.py", line 196, in parse >>> value = what.parse(c_elt, ps) >>> File "/opt/foo/modules/ZSI/TCcompound.py", line 196, in parse >>> value = what.parse(c_elt, ps) >>> File "/opt/foo/modules/ZSI/TCcompound.py", line 196, in parse >>> value = what.parse(c_elt, ps) >>> File "/opt/foo/modules/ZSI/TC.py", line 1389, in parse >>> pyobj = Any().parse_into_dict_or_list(elt, ps) >>> File "/opt/foo/modules/ZSI/TC.py", line 553, in parse_into_dict_or_list >>> v.append((str(c_elt.localName), >>> self.__class__(**self.kwargs).parse(c_elt, ps))) >>> File "/opt/foo/modules/ZSI/TC.py", line 591, in parse >>> ps.Backtrace(elt)) >>> ZSI.EvaluateException: Any can't parse element >>> [Element trace: >>> /soapenv:Envelope/soapenv:Body/RetrievePropertiesResponse/returnval/propSet[2]/val/ResourceConfigSpec[1]] >>> >>> Do you think this is related, or is it another bug? Anything I can do >>> tohelp with debugging? Should I submit this as a tracker item? >>> >>> Best regards, >>> Peter Åstrand >>> >>> On Wed, 8 Apr 2009, Joshua Boverhof wrote: >>> >>>> The bug I thought you came across is a known problem with minidom >>>> resolvingthe default namespace. >>>> >>>> ""Minidom bug in ParsedSoap: Default namespace is empty - >>>> ID:1810600""" >>>> >>>> But I plugged in 4Suite, without any modifications from my formula ( maybe >>>> aversioning difference in regards to 4Suite ), and got the same error. So >>>> Ilooked at TC.py and found the problem, it's trivial, probably occurred as >>>> aresult of some refactoring since it is correctly handled elsewhere. >>>> >>>> Please submit a ZSI bug report and I'll fix this pronto. >>>> >>>> -josh >>>> >>>> >>>> >>>> On Apr 8, 2009, at 12:47 AM, Peter Åstrand wrote: >>>> >>>>>> ZSI-2.1a uses minidom, this is beneficial in several ways but is not >>>>>> ascomplete a DOM solution as PyXML. >>>>> I understand that minidom is not a complete DOM parser, but does >>>>> anyonehave an idea what is actually missing? The 2.1a1 release notes also >>>>> talkesabout this: >>>>> "Also minidom is now used as the default parser because PyXML is no >>>>> longersupported. There are known issues with minidom, but for most >>>>> applicationsit is sufficient." >>>>> This is very vague. How do I know for which applications minidom >>>>> issufficient?http://docs.python.org/library/xml.dom.minidom.html#minidom-and-the-dom-standardlooks >>>>> like a good documentation on what minidom actually supports, but froma >>>>> quick glance, I cannot find anything there that indicates that >>>>> minidomlacks some fundamental feature that should prevent SOAP >>>>> communication withVMware. >>>>> Regards, >>>>> Peter Åstrand >>>>>> On Apr 7, 2009, at 7:13 AM, Peter Åstrand wrote: >>>>>> >>>>>> We are using ZSI to communicate with VMware vCenter. When we are >>>>>> usingZSI 2.0, things works quite >>>>>> well, except that the performance is quite bad: The Python processeats >>>>>> a lot of CPU when parsing >>>>>> the responses. As I understand it, 2.1 should be much faster. >>>>>> However,when we are trying 2.1a1, >>>>>> we are getting tracebacks: >>>>>> >>>>>> File "/opt/foo/modules/bar/vilibrary.py", line 54, >>>>>> inget_resource_pool >>>>>> resources = vi.RetrieveAllProperties("ResourcePool") >>>>>> File "/opt/foo/modules/bar/viframework.py", line 314, >>>>>> inRetrieveAllProperties >>>>>> foobar = self . proxy . RetrieveProperties ( c ) >>>>>> File "/opt/foo/modules/bar/VimService_services.py", line 61, >>>>>> inRetrieveProperties >>>>>> response >>>>>> =self.binding.Receive(RetrievePropertiesResponseMsg.typecode) >>>>>> File "/opt/foo/modules/ZSI/client.py", line 536, in Receive >>>>>> return _Binding.Receive(self, replytype, **kw) >>>>>> File "/opt/foo/modules/ZSI/client.py", line 461, in Receive >>>>>> reply = self.ps.Parse(tc) >>>>>> File "/opt/foo/modules/ZSI/parse.py", line 326, in Parse >>>>>> return how.parse(self.body_root, self) >>>>>> File "/opt/foo/modules/ZSI/TCcompound.py", line 196, in parse >>>>>> value = what.parse(c_elt, ps) >>>>>> File "/opt/foo/modules/ZSI/TCcompound.py", line 196, in parse >>>>>> value = what.parse(c_elt, ps) >>>>>> File "/opt/foo/modules/ZSI/TCcompound.py", line 196, in parse >>>>>> value = what.parse(c_elt, ps) >>>>>> File "/opt/foo/modules/ZSI/TC.py", line 1375, in parse >>>>>> pyobj = Any().parse_into_dict_or_list(elt, ps) >>>>>> File "/opt/foo/modules/ZSI/TC.py", line 545, >>>>>> inparse_into_dict_or_list >>>>>> v.append((str(c_elt.localName),self.__class__(**self.kwargs).parse(c_elt, >>>>>> ps))) >>>>>> File "/opt/foo/modules/ZSI/TC.py", line 550, in parse >>>>>> (ns,type) = self.checkname(elt, ps) >>>>>> File "/opt/foo/modules/ZSI/TC.py", line 201, in checkname >>>>>> return self.checktype(elt, ps) >>>>>> File "/opt/foo/modules/ZSI/TC.py", line 219, in checktype >>>>>> ps.Backtrace(elt)) >>>>>> ZSI.EvaluateException: Malformed type attribute (bad NS) >>>>>> [Element trace: >>>>>> /soapenv:Envelope/soapenv:Body/RetrievePropertiesResponse/returnval/propSet[2]/val/ResourceConfigSpec[1]] >>>>>> >>>>>> I've tried to debug the problem, but haven't really found a >>>>>> solution.I've noticed a few strange >>>>>> things, though, such that: >>>>>> >>>>>> * checktype() calls: >>>>>> >>>>>> uri = ps.GetElementNSdict(elt).get(prefix) >>>>>> >>>>>> ...with prefix being None. With 2.0, this actually works(!). With >>>>>> 2.1,the uri is instead indexed >>>>>> as ''. >>>>>> >>>>>> * In GetElementNSdict, there's this statement: >>>>>> >>>>>> if a.namespaceURI == XMLNS.BASE: >>>>>> if a.localName == "xmlns": >>>>>> d[''] = a.nodeValue >>>>>> else: >>>>>> d[a.localName] = a.nodeValue >>>>>> >>>>>> With 2.0, a.namespaceURI is equal to XMLNS.BASE, but with >>>>>> 2.1,a.namespaceURI is >>>>>> "http://www.w3.org/2001/XMLSchema-instance" rather than XMLNS.BASE >>>>>> (="http://www.w3.org/2000/xmlns/"). Is this relevant, perhaps? >>>>>> >>>>>> The response begins like this: >>>>>> >>>>>> 200 >>>>>> OK >>>>>> ------- >>>>>> Date: Tue, 7 Apr 2009 09:41:50 GMT >>>>>> Cache-Control: no-cache >>>>>> Content-Type: text/xml; charset=utf-8 >>>>>> Content-Length: 7933 >>>>>> >>>>>> <?xml version="1.0" encoding="UTF-8"?> >>>>>> <soapenv:Envelopexmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" >>>>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >>>>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema" >>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> >>>>>> <soapenv:Body> >>>>>> <RetrievePropertiesResponse xmlns="urn:vim25"><returnval><obj >>>>>> type="ResourcePool">resgroup-7</obj><propSet><name>availableField</name><val >>>>>> xsi:type="ArrayOfCustomFieldDef"></val></propSet><propSet><name>childConfiguration</name><val >>>>>> xsi:type="ArrayOfResourceConfigSpec"><ResourceConfigSpecxsi:type="ResourceConfigSpec"><entitytype="ResourcePool">resgroup-40</entity><cpuAllocation><reservation>0</reservation><expandableReservation>tru >>>>>> e</expandableReservation><limit>-1</limit><shares><shares>4000</shares><level>normal</level></shares></cpuAll >>>>>> ocation><memoryAllocation><reservation>0</reservation><expandableReservation>true</expandableReservation><lim >>>>>> it>-1</limit><shares><shares>163840</shares><level>normal</level></shares></memoryAllocation></ResourceConfig >>>>>> Spec><ResourceConfigSpecxsi:type="ResourceConfigSpec"><entitytype="ResourcePool">resgroup-41</entity><cpuAllocation><reservation>0</reservation><expandableReservation>tru >>>>>> e</expandableReservation><limit>-1</limit><shares><shares>4000</shares><level>normal</level></shares></cpuAll >>>>>> ocation><memoryAllocation><reservation>0</reservation><expandableReservation>true</expandableReservation><lim >>>>>> it>-1</limit><shares><shares>163840</shares><level>normal</level></shares></memoryAllocation></ResourceConfig >>>>>> Spec><ResourceConfigSpec xsi:type="ResourceConfigSpec"> >>>>>> >>> |