tags:

views:

981

answers:

1

Hi I am looking to create a SOAP service within my Django App, but have come across a few hitches. Firstly I have been able to successfully follow the soaplib Hello World tutorial (google "soaplib hello world" since I only can use 1 hyperlink as this is my first question) which uses a CheryPy WSGI server to run the service, and the soaplib client to initiate a SOAP request.

I am having trouble converting that into a service within Django through following this djangosnippets snippet. Currently I am using the Django development server.

Viewing http://localhost:8000/hello_world/ in the browser or making 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 is matching correctly, but according to that django snippet I linked to, there shouldn't be a view hello_world_service.

I feel I am missing the last step and any knowledge would be really helpful.

Thanks, Marcus

+4  A: 

According to the snippet you link 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 onto the name hello_world_service, for use in your urls.py file.

If that line is included, then there will indeed be a view with that name - so the URL Dispatcher should be able to find it.

Hope that does it,

Rob

Rob Golding
Thanks rob, that was exactly the problem, I can now make SOAP requests to Django.
Marcus Whybrow