开发者

SOAP service in Django with soaplib

开发者 https://www.devze.com 2022-12-08 14:45 出处:网络
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 he

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 convert开发者_如何学Cing 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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消