How can I change the way of defining/binding namespaces for string array in zeep library?

35 views
Skip to first unread message

Sencer Hamarat

unread,
Oct 25, 2021, 7:47:54 AM10/25/21
to django...@googlegroups.com
Zeep library is generating string arrays with each child tag has it's own namespace definition:

<ns1:Images>
    <ns2:string xmlns:ns2="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        https://www.example.com/variant_image.png
    </ns2:string>
    <ns3:string xmlns:ns3="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        https://www.example.com/variant_image2.png
    </ns3:string>
    <ns4:string xmlns:ns4="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        https://www.example.com/variant_image3.png
    </ns4:string>
</ns1:Images>
But, the API I'm dealing with is strictly want the namespace of the array must be defined on parent tag and, same namespace must be used on each child tag. Eg.

<ns1:Images xmlns:ns2="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <ns2:string>https://www.siteniz.com/variant_image.png</ns2:string>
    <ns2:string>https://www.siteniz.com/variant_image2.png</ns2:string>
    <ns2:string>https://www.siteniz.com/variant_image3.png</ns2:string>
</ns1:Images>
How can I force the zeep to generate string array XML like the format above?

Regards,
Sencer HAMARAT

Kasper Laudrup

unread,
Oct 25, 2021, 12:54:51 PM10/25/21
to django...@googlegroups.com
On 25/10/2021 13.46, Sencer Hamarat wrote:
>
> How can I force the zeep to generate string array XML like the format above?
>

Maybe you should ask in some kind of forum or similar related to zeep
(whatever that is).

This mailing list is for Django users and I fail to see how this is
related to that at all, unless I'm missing something?

Kind regards,

Kasper Laudrup
OpenPGP_0xE5D9CAC64AAA55EB.asc
OpenPGP_signature
Reply all
Reply to author
Forward
0 new messages