[Soap-Python] AnyAsDict(String)
Burak Arslan
burak.arslan at arskom.com.tr
Wed Oct 13 17:15:25 CEST 2010
On 10/13/10 17:15, mukkera harsha wrote:
> But, we are converting an XMl file into a dictionary. So where should
> we tell that so and so XML file should be converted into dictionary .
> Where should we give the filename ?
>
read the file and convert it to xml and later to dict if you want:
xml_string = open('myfile.xml', 'r').read()
xml_etree = etree.fromstring(xml_string)
xml_dict = soaplib.util.etreeconv.rroot_etree_to_dict(xml_etree)
or use the attachment serializer.
http://github.com/arskom/soaplib/blob/1_0/src/soaplib/serializers/binary.py
burak
> On Wed, Oct 13, 2010 at 8:51 AM, Burak Arslan
> <burak.arslan at arskom.com.tr <mailto:burak.arslan at arskom.com.tr>> wrote:
>
> On 10/13/10 03:23, mukkera harsha wrote:
>> Hi,
>>
>> I am getting the following errror :
>>
>> Traceback (most recent call last):
>> File "workflowexecutionservice.py", line 24, in
>>
>> |class Subworkflow(ClassSerializer):
>> |
>>
>> File "workflowexecutionservice.py", line 26, in Subworkflow
>>
>> |files = AnyAsDict(String)
>> |
>>
>> TypeError: *new*() takes exactly 1 argument (2 given)
>>
>> -------------
>>
>> I attached is the source code. Please help me to get through this
>> problem.
>>
>>
>> _______________________________________________
>> Soap mailing list
>> Soap at python.org <mailto:Soap at python.org>
>> http://mail.python.org/mailman/listinfo/soap
>
>
> hi,
>
> AnyAsDict(String) does not make sense. just use AnyAsDict.
>
> You also should return a dictionary whose values are inside iterables.
>
> not like:
>
> {'return_key': 'return value'}
>
> but like:
>
> {'return_key': ['return_value']}
>
> hope that helps
> burak
>
>
>
>
>
>
> --
> Harshavardhan Reddy Mukkera.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/soap/attachments/20101013/d08fff4d/attachment.html>
More information about the Soap
mailing list