xmlrpc::remote_call (public)

 xmlrpc::remote_call url method [ args ]

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

Invoke a method on a remote server using XML-RPC

Parameters:
url (required)
url of service
method (required)
method to call
args (optional)
list of args to the method
Returns:
the response of the remote service. Error if remote service returns a fault.

Partial Call Graph (max 5 caller/called nodes):
%3 xml_doc_free xml_doc_free (public) xml_doc_render xml_doc_render (public) xml_parse xml_parse (public) xmlrpc::construct xmlrpc::construct (private) xmlrpc::httppost xmlrpc::httppost (private) xmlrpc::remote_call xmlrpc::remote_call xmlrpc::remote_call->xml_doc_free xmlrpc::remote_call->xml_doc_render xmlrpc::remote_call->xml_parse xmlrpc::remote_call->xmlrpc::construct xmlrpc::remote_call->xmlrpc::httppost

Testcases:
No testcase defined.
Source code:
    set call "<?xml version=\"1.0\"?><methodCall><methodName>$method</methodName>"
    append call "<params>"
    if { [llength $args] } {
        append call [xmlrpc::construct {param value} $args]
    }
    append call "</params></methodCall>"
    # now re-parse and then re-extract to make sure it's well formed
    set doc [xml_parse -persist $call]
    if { [catch {xml_doc_render $doc} request] } {
        return -code error  "xmlrpc::fault XML is not well formed. error = $request"
    }
    xml_doc_free $doc

    # make the call
    if {[catch {xmlrpc::httppost -url $url -content $request } response ]} {
        ns_log error xmlrpc::remote_call  url: $url request: $request error: $response
        return -code error [list HTTP_ERROR  "HTTP request failed due to \"$response\""]
    }
    return [xmlrpc::parse_response $response]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: