system.multicall (public)

 system.multicall array

Defined in packages/xml-rpc/tcl/system-procs.tcl

Perform multiple requests in one call - see http://www.xmlrpc.com/discuss/msgReader$1208

Takes an array of XML-RPC calls encoded as structs of the form (in a Pythonish notation here):

    {'methodName': string, 'params': array}
    

Parameters:
array - array of structs containing XML-RPC calls
Returns:
an array of responses. There will be one response for each call in the original array. The result will either be a one-item array containing the result value - this mirrors the use of <params> in <methodResponse> - or a struct of the form found inside the standard <fault> element.
Author:
Vinod Kurup

Partial Call Graph (max 5 caller/called nodes):
%3 xmlrpc::invoke_method xmlrpc::invoke_method (private) system.multicall system.multicall system.multicall->xmlrpc::invoke_method

Testcases:
No testcase defined.
Source code:
    set responses [list]

    foreach call $array {
        # parse the call for methodName and params
        if { [catch {
            array unset c
            array set c $call
            set method $c(methodName)
            set params $c(params)
        } errmsg ] } {
            # if we can't get a methodName and params, then fault
            lappend responses [list -struct  [list faultCode [list -int 5]  faultString "Invalid request. $errmsg"
                                   ]]
        } else {
            # call the method
            set errno [catch {xmlrpc::invoke_method $method $params} result]
            if { $errno } {
                # fault
                lappend responses [list -struct  [list faultCode [list -int $errno]  faultString $result]]
            } else {
                lappend responses $result
            }
        }
    }
    return [list -array $responses]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: