Wednesday, March 18, 2015

Re: Import error - No module named http

iam to getting same error

------------------------------------------------------------------------------------------------------------------------

Traceback (most recent call last):
  File "test_soap.py", line 4, in <module>
    http.request("POST", "/path/to/my/webservice", body=xml, headers = {
NameError: name 'http' is not defined

---------------------------------------------------------------------------------------------------------------------------

On Wednesday, 18 March 2015 21:54:40 UTC+5:30, Nivin Paul wrote:
I need to call a web service that written using SOAP from a django application , to do that i used the following code but i got error as in the attached screenshot. Please help


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())

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ceeb7793-d801-4022-8b9a-8bf60616248f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment