I am tasked to setup a webserver which listens for incoming HTTP POST requests that contain xml content. upon receiving POST request, Web server should parse the xml content and insert extracted data in to database.
I have setup an Apache(version 2.2) server on centos and written simple python cgi that will get called when post request is received.
In python script I could access predefined attributes (eg: query string, cookies etc..) via environment variables. but couldn't figure out how to access xml content in python code!
Hope you guys could let me know how to access xml content in python cgi script.
<?xml version="1.0" encoding="utf-8"?>
<Events xmlns:i="http://www.w3.org/2001/XMLSchema-instance2" xmlns="http://schemas.datacontract.org/2004/07/foo.Web.Impl.Services.Data">
<Event>
<EventType>AORCreated</EventType>
<EventID>c3a09825-38b6-499f-81fc-9f821e4695ed</EventID>
<UserID>743d61a2-d8da-431c-8aa4-70912dd00ecb</UserID>
<LicenseeID>1</LicenseeID>
<Culture>en-GB</Culture>
<Properties>
<Property>
<Key>AOR</Key>
<Value>[email protected]</Value>
</Property>
</Properties>
</Event>
</Events>
Thanks in advance, Prasun