Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use HTTP Post Requests for SOAP? - SOAP and Django

I am wondering if I could use simply use HTTP POST Requests in order to implement a SOAP API.

If so how should I format and treat the requests?

like image 523
RadiantHex Avatar asked Apr 02 '10 17:04

RadiantHex


1 Answers

Yep, I have done this in certain cases where SOAPpy did not work with a given schema. This should get you started.

import httplib
from xml.dom import minidom

http.request("POST", "/path/to/my/webservice", body=xml, headers = {
    "Host": "myservername",
    "Content-Type": "text/xml; charset=UTF-8",
    "Content-Length": len(xml)
})

print minidom.parseString(http.getresponse().read())

For the content string, I would use SoapUI to make the requests manually, and then mimic the XML.

like image 160
Chase Seibert Avatar answered Sep 27 '22 22:09

Chase Seibert