xmlrpc::parse_response (private)
xmlrpc::parse_response xml
Defined in packages/xml-rpc/tcl/xml-rpc-procs.tcl
Parse the response from an XML-RPC call.
- Parameters:
- xml (required)
- the XML response
- Returns:
- result
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set doc [xml_parse -persist $xml] set root [xml_doc_get_first_node $doc] if { [xml_node_get_name $root] ne "methodResponse" } { set root_name [xml_node_get_name $root] xml_doc_free $doc return -code error "xmlrpc::parse_response: invalid server response - root node is not methodResponse. it's $root_name" } set node [xml_node_get_first_child $root] switch -- [xml_node_get_name $node] { params { # need more error checking here. # if the response is not well formed, we'll probably # get an error, but it may be hard to track down set param [xml_node_get_first_child $node] set value [xml_node_get_first_child $param] set result [xmlrpc::decode_value $value] } fault { # should do more checking here... array set fault [xmlrpc::decode_value [xml_node_get_first_child $node]] xml_doc_free $doc return -code error -errorcode $fault(faultCode) $fault(faultString) } default { set type [xml_node_get_name $node] xml_doc_free $doc return -code error "xmlrpc::parse_response: invalid server response ($type)" } } xml_doc_free $doc return $resultXQL Not present: Generic, PostgreSQL, Oracle