The spyne.decorator module contains the the @srpc decorator and its helper methods. The @srpc decorator is responsible for tagging methods as remote procedure calls extracting method’s input and output types.
It’s possible to create custom decorators that wrap the @srpc decorator in order to have a more elegant way of passing frequently-used parameter values. The @rpc decorator is a simple example of this.
Method decorator to tag a method as a remote procedure call in a spyne.service.ServiceBase subclass.
You should use the spyne.server.null.NullServer transport if you want to call the methods directly. You can also use the ‘function’ attribute of the returned object to call the function itself.
_operation_name vs _in_message_name: Soap clients(SoapUI, Savon, suds) will use the operation name as the function name. The name of the input message(_in_message_name) is irrelevant when interfacing in this manner; this is because the clients mostly wrap around it. However, the soap xml request only uses the input message when posting with the soap server; the other protocols only use the input message as well. _operation_name cannot be used with _in_message_name.
Method decorator to tag a method as a remote procedure call. See spyne.decorator.rpc() for detailed information.
The initial “s” stands for “static”. In Spyne terms, that means no implicit first argument is passed to the user callable, which really means the method is “stateless” rather than static. It’s meant to be used for existing functions that can’t be changed.