Tuesday, July 3, 2012

Still need help with the 405....please

Below is the code from the views.py

The 405 is retunred from the 'return super(DjangoSoapApp,
self).__init__(Application(services, tns))' statement. I am using
python 2.6, soaplib20 and django 1.3. I am struggling to understand
what exactly is wrong here.



class HelloWorldService(DefinitionBase):
@soap(String,Integer,_returns=Array(String))
def say_smello(self,name,times):
results = []
for i in range(0,times):
results.append('Hello, %s'%name)
return results

class DjangoSoapApp(WSGIApplication):
csrf_exempt = True

def __init__(self, services, tns):
"""Create Django view for given SOAP soaplib services and
tns"""

return super(DjangoSoapApp,
self).__init__(Application(services, tns))

def __call__(self, request):
django_response = HttpResponse()

def start_response(status, headers):
django_response.status_code = int(status.split(' ', 1)[0])
for header, value in headers:
django_response[header] = value

response = super(DjangoSoapApp, self).__call__(request.META,
start_response)
django_response.content = '\n'.join(response)

return django_response

# the view to use in urls.py
hello_world_service = DjangoSoapApp([HelloWorldService], '__name__')

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate