XmlRpcMethodResponse * vortex_xml_rpc_invoke_sync ( VortexChannel channel,
XmlRpcMethodCall method_call 
)

Perform a synchronous XML-RPC invocation using a method call already built over an already booted XML-RPC channel.

The function will take the method definition found in method_call and will perform a XML-RPC invocation, blocking the caller until finished completely, over the channel selected. To boot a channel running the XML-RPC over BEEP profile use the following function: vortex_xml_rpc_boot_channel_sync.

This function is built on top of vortex_xml_rpc_invoke, so check documentation for that function to know more. See also: vortex_xml_rpc_method_call_new in special automatic invocator deallocation performed by the XML-RPC engine.

Here is an example:

1 // peform a synchronous method
2 response = vortex_xml_rpc_invoke_sync (channel, invocator);
3 
4 // check result received
5 switch (method_response_get_status (response)) {
6 case XML_RPC_OK:
7  printf ("Reply received ok, result is: %s\n", method_response_stringify (response));
8  break;
9 default:
10  printf ("RPC invocation have failed: (code: %d) : %s\n",
11  method_response_get_fault_code (response),
12  method_response_get_fault_string (response));
13  break;
14 }
15 
16 // free the response received
17 method_response_free (response);
18 
19 // but DONT FREE method call. See XmlRpcMethodCall object information.
Parameters
channelThe channel where the invocation will be performed.
method_callThe invocator object, representing the method call.
Returns
A XmlRpcMethodResponse with the reply or NULL if fails.

References method_response_new, vortex_async_queue_new(), vortex_async_queue_ref(), vortex_async_queue_timedpop(), vortex_async_queue_unref(), vortex_channel_get_ctx(), vortex_connection_get_timeout(), vortex_xml_rpc_invoke(), and XML_RPC_TIMEOUT_ERROR.