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?

$ python examples/method_names.py
Traceback (most recent call last):
  File "examples/method_names.py", line 15, in <module>
    application = Application([Tiny],  'namespace')
  File 
"/usr/local/lib/python2.6/dist-packages/soaplib-1.0.0_beta8-py2.6.egg/soaplib/wsgi.py",
 line 89, in __init__
    self.build_schema()
  File 
"/usr/local/lib/python2.6/dist-packages/soaplib-1.0.0_beta8-py2.6.egg/soaplib/wsgi.py",
 line 174, in build_schema
    o.__module__, o.__name__, method.name))
Exception: __main__.Tiny.doit overwrites __main__.Tiny.doit


BTW, Tiny has attributes wibble and wobble (which I do expect).  I was 
expecting my SOAP service to have wibble and wobble methods, but perhaps it has 
a doit.


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