Akhil Sundar
Akhil Sundar

Reputation: 1317

Generating standard xml and making request in Python/Django

I need to generate a standard XML as follows using python:

<?xml version="1.0" encoding="UTF-8"?>
<req:ShipmentValidateRequestAP xmlns:req="http://www.example.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.com/schema">

<root>
    <doc>
        <field1>some value1</field1>
        <field2>some vlaue2</field2>
    </doc>
</root>

</req:ShipmentValidateRequestAP>

And this needed to be requested to a server URL:

https://sampletest-ea.example.com/XMLShippingServlet

Can anybody please help me to implement this ?

Upvotes: 0

Views: 93

Answers (1)

YaleCheung
YaleCheung

Reputation: 620

you can finish your work by the help of http://docs.python.org/2/library/xml.dom.minidom.html. It is a simple libary

Upvotes: 1

Related Questions