[Fedora-suds-list] Setting Value of Extension of types

Garth Bushell garth at garthy.com
Thu Apr 15 13:44:03 UTC 2010


> I believe the factory (based on the schema) will create and return a
> suds.sudsobject.Property object which has a 'value' attribute that is not in
> the keylist.  Try setting the value and type as:
>
>> mor._type = 'foo'
>> mor.value = 'bar'
>
> and then:
>
>> print mor
> (Property){
>   value = "foo"
>   _type = "bar"
>  }
>
> Is this true in your case?
>
> Simple types that have attributes are quite rare and the Property class was
> developed for exactly this case.

Isn't it a  "complexType"?

Though I'm not sure what this would mean. :-/

>
> hope this helps,
>

It doesn't seem to be a property

>>> mor=client.factory.create('ns0:ManagedObjectReference')
>>> mor._type = "ServiceInstance"
>>> mor.value = "ServiceInstance"
>>> mor.__class__
<class suds.sudsobject.ManagedObjectReference at 0xda8c08c>
>>> print mor
DEBUG:suds.sudsobject:['_type', 'value'] must be superset of
[u'_type'], ordering ignored
(ManagedObjectReference){
   _type = "ServiceInstance"
   value = "ServiceInstance"
 }

So this seems to work but when I try to pass it to a method that takes
a "ManagedObjectReference" object I get:-

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.linux-i686/egg/suds/client.py", line 539, in __call__
    return client.invoke(args, kwargs)
  File "build/bdist.linux-i686/egg/suds/client.py", line 592, in invoke
    msg = binding.get_message(self.method, args, kwargs)
  File "build/bdist.linux-i686/egg/suds/bindings/binding.py", line
119, in get_message
  File "build/bdist.linux-i686/egg/suds/bindings/document.py", line
63, in bodycontent
  File "build/bdist.linux-i686/egg/suds/bindings/document.py", line
105, in mkparam
  File "build/bdist.linux-i686/egg/suds/bindings/binding.py", line
266, in mkparam
  File "build/bdist.linux-i686/egg/suds/mx/core.py", line 62, in process
  File "build/bdist.linux-i686/egg/suds/mx/core.py", line 75, in append
  File "build/bdist.linux-i686/egg/suds/mx/appender.py", line 102, in append
  File "build/bdist.linux-i686/egg/suds/mx/appender.py", line 243, in append
  File "build/bdist.linux-i686/egg/suds/mx/appender.py", line 182, in append
  File "build/bdist.linux-i686/egg/suds/mx/core.py", line 74, in append
  File "build/bdist.linux-i686/egg/suds/mx/literal.py", line 87, in start
suds.TypeNotFound: Type not found: 'value'

I can enable debug if that helps and send the output? It's quite big.

Thanks for your quick response.

Garth


More information about the suds mailing list