Django SOAP service with soaplib

Hi, I am looking to create a SOAP service in my Django application, but have encountered a few taps. Firstly, I was able to successfully complete the Hello World (soaplib Hello World) tutorial (google "soaplib hello world", since I can only use one hyperlink, since this is my first question), which uses the CheryPy WSGI server to start the service. and the soaplib client, initiate a SOAP request.

I am having trouble converting this to a service in Django using this djangosnippets snippet . I am currently using a Django development server.

Viewing http://localhost:8000/hello_world/ in a browser or a SOAP request using the soaplib client returns a Django error page with the error:

Tried hello_world_service in module foo.views. Error was: 'module' object has no attribute 'hello_world_service'

Obviously urls.py matches correctly, but there shouldn't be a hello_world_service view according to this django snippet I'm linked to.

I feel that I am missing the last step, and any knowledge will be really useful.

Thanks Marcus

+6
soap django
source share
1 answer

According to the snippet you are linking to, the bottom of your views.py file should contain the following line:

 hello_world_service = HelloWorldService() 

This maps an instance of the HelloWorldService class to hello_world_service for use in your urls.py file.

If this line is included, then there really will be a view with that name, so the URL manager should find it.

Hope it does,

Rob

+7
source share

All Articles