Snippet List
I've updated the `DjangoSoapApp` class from [this popular soaplib snippet](http://djangosnippets.org/snippets/2210/) so the snippet will work properly with soaplib 2.0.
Usage is the same as before:
my_soap_service = DjangoSoapApp([MySOAPService], __name__)
The popular [soaplib snippet](http://djangosnippets.org/snippets/979/) works only with older soaplib (0.8, for example). This snippet is modifed to work with newer soaplib: it was tested with 0.9.2-alpha3 and 1.0.0-beta4. I've tested suds python client and .NET client.
Based on our [first version of soaplib service integration](http://www.djangosnippets.org/snippets/979/), this second one adds Basic Auth with credentials specified in settings.
It can be tested with [django soaplib test cliente](http://www.djangosnippets.org/snippets/1406/)
This snippet is a replacement views.py for [SOAP views with on-demand WSDL generation](http://www.djangosnippets.org/snippets/979/)
It iterates over your installed apps looking for web_service.py in each one, any methods decorated with @soapmethod within web_service.py will automatically be imported into the local namespace making them visible in the WSDL.
It will blindly override local objects of the same name so it's not very safe (could do with some more error checks) but it works very well.
- soap
- soaplib
- wsdl
- web-services
Optio's [soaplib](http://trac.optio.webfactional.com/wiki/soaplib) makes it really straightforward to write SOAP web service views by using a decorator to specify types. Plus it's the only Python library, as of today, which is able to generate WSDL documents for your web service.
You can test it with a soaplib client:
>>> from soaplib.client import make_service_client
>>> from foo.views import HelloWorldService
>>> client = make_service_client('http://localhost:8000/hello_world/', HelloWorldService())
>>> client.say_hello('John', 2)
['Hello, John', 'Hello, John']
And get an WSDL document:
>>> client.server.wsdl('')
'<?xml version=\'1.0\' encoding=\'utf-8\' ?><definitions name="HelloWorldService"
...
</definitions>'
7 snippets posted so far.