> From: Chris Austin
> Sent: 25 March 2011 17:03

> On Fri, Mar 25, 2011 at 10:47 AM, J.Fine <[email protected]> wrote:
> > Hi
> >
> > I was surprised to get an exception from this piece of code.
> >
> > $ cat examples/method_names.py
> > from soaplib.service import rpc, DefinitionBase from
> > soaplib.serializers.primitive import String from
> soaplib.wsgi import
> > Application
> >
> > def doit(self):
> >    return 'this is a string'
> >
> >
> > class Tiny(DefinitionBase):
> >
> >    # Unpack the rpc decorator.
> >    wibble = rpc(_returns=String)(doit)
> >    wobble = rpc(_returns=String)(doit)
> >
> > application = Application([Tiny],  'namespace')
> >
> >
> > And I was surprised by the exception I got.  How does
> soaplib know that my function was called doit?  And should it know?
> >
>
> This is how soaplib works.  Soaplib introspects the methods
> decorated with @soap, @rpc or, @document.  It crams these
> web-methods into a public_methods dictionary.

Yes, but this does not explain why 'doit' is used (twice) as the key in the 
public_methods dictionary, rather than 'wibble' and 'wobble'.  Reading the code 
for Tiny I'd be expecting to get two web-methods (wibble and wobble) and not 
doit and an exception.
--
Jonathan

-- 
The Open University is incorporated by Royal Charter (RC 000391), an exempt 
charity in England & Wales and a charity registered in Scotland (SC 038302).

_______________________________________________
Soap mailing list
[email protected]
http://mail.python.org/mailman/listinfo/soap

Reply via email to