简体   繁体   中英

Soaplib functions with default arguments

I have to write soaplib method, that has many arguments. The idea is that the user should able able to choose, which arguments he wants to provide. Is that even possible?

I know it is possible in python generally, but there is an error, when i try to set it up like normal python method with default arguments.

Create complex type

class Parameters(ClassSerializer):
    class types:
        param1 = primitive.String
        param2 = primitive.String
        param3 = primitive.String

...

@soapmethod(Parameters, _returns=primitive.String, _outVariableName='return')
def soSomething(self, parameters):
    if parameters.param1 and parameters.param1 != "": # or something like this
       # ...
    elif ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM