[Soap-Python] multiple services with soaplib-0.9.1-alpha1
Luca Dariz
luca.dariz at unife.it
Tue Aug 3 12:08:33 CEST 2010
> i just made a new release that lets you give an iterable of service
> definitions (not instances) to wsgi.Application. this helps complex
> applications that want to provide web services under the same
> targetNamespace but want them defined under different classes.
>
>
Hi,
I am wondering if wouldn't be better to have instances of services
instead of definitions.
This way would be easier to subclass DefinitionBase, maybe defining a
__call__ method and pass there the http environment, and one could write
something like:
class MyService(DefinitionBase):
def __init__(self, data):
DefinitionBase.__init__(self)
self._something_needed = data
services = [MyService(something_heavy)]
application = Application(services, 'ServiceTNS')
Here something_needed could be for example some database connection, or
something that could be nice to have persistent into the service, since
the methods are called on it.
To me it looks like this way services would be more customizable, what
do you think?
Regards,
Luca
More information about the Soap
mailing list