Hi Dieter

On 2 December 2010 09:01, Dieter Maurer <[email protected]> wrote:
> Michael Wood wrote at 2010-12-1 14:05 +0200:
>> ...
>>>>> s = AnyAsDict()
>>>>> s.to_xml({"a": ["One"], "b": ["Two"], "c": [3]}, 'tns', parent)
>>>>> for element in parent.getchildren():
>>...     print etree.tostring(element)
>>...
>><ns0:retval xmlns:ns0="tns"><a>One</a><c>3</c><b>Two</b></ns0:retval>
>>>>> print s.from_xml(parent.getchildren()[0])
>>{'a': ['One'],'c': ['3'],'b': ['Two']}
>
> As you can see, you have lost type information: the integer "3"
> has been converted into the string "'3'".

Good point.  I didn't notice yesterday.

> When types are important for your client sides, then this is likely
> not good enough.

Thanks.

Is there perhaps a way to retain the type information while using Any
or AnyAsDict?

For the moment I'm just ignoring the extensibility nice-to-have and
using the ClassSerializer.

-- 
Michael Wood <[email protected]>
_______________________________________________
Soap mailing list
[email protected]
http://mail.python.org/mailman/listinfo/soap

Reply via email to