arskom/rpclib — Issue #101: @srpc does not play well with other decorators
Author: deignacio
Created: 2011-10-18 19:28:07+00:00
State: open

from functools import wraps
from rpclib.decorator import srpc
from rpc.model.complex import Iterable
from rpclib.model.primitive import String
from rpclib.service import ServiceBase

def decorator(f):
@wraps(f)
def wrapped_f(*args, **kwargs):
return f(*args, **kwargs)
return wrapped_f

class FooSoapService(ServiceBase):
@srpc(String, Integer, _returns=Iterable(String)
def repeat_msg(msg, count):
return [msg] * count

@srpc(String, Integer, _returns=Iterable(String)
@decorator
def decorated_repeat_msg(msg, count):
return [msg] * count

when viewing the generated wsdl for this service, you get the following for the method signatures