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):
- 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