def SetRequestParams(config, method_name, params): """Set SOAP request parameters. Args: config: dict Dictionary object with populated configuration values. method_name: str API method name. params: list List of parameters to send to the API method. Returns: instance SOAPpy.Types.bodyType with set parameters. """ # Set namespace at method's level. params = SOAPpy.Types.untypedType(Utils.MakeTextXMLReady(params)) params._setAttr('xmlns', config['ns_target'][0]) # Set namespace at body's level. body = SOAPpy.Types.bodyType({method_name: params}) body._setAttr('xmlns', config['ns_target'][0]) return body