0

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 ?

4
  • 1
    OK. So what's stopping you? Commented Sep 24, 2013 at 8:21
  • I just want to know a perfect way to implement the same... Commented Sep 24, 2013 at 8:30
  • What do you need help with specifically. This is not the place to ask people to do your work for you, this is to ask for help with an attempt that you already made that didn't work. Commented Sep 24, 2013 at 9:07
  • I tried it with urllib2 but with that i can generate only the '<root>,/root>' tags and the contents within that, actually i need help to create an xml file that starts with '<?xml version="1.0" encoding="UTF-8"?>' and '<req:ShipmentValidateRequestAP>' tags as specified above. Commented Sep 24, 2013 at 9:28

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.