Hello,
In an Abyss server method call I would like to save the value of the
array that is passed in to a file, and later I would like to 'restore'
that value to a usable xmlrpc_value. I am currently saving the array as
a serialized value, as shown in the code snippet below. My questions
are:
1. Is there an easier way to save the array?
2. How would I go about restoring the saved value, back into an
xmlrpc_value?
thanks,
Ken Colson
static xmlrpc_value *Mymethod (xmlrpc_env, xmlrpc_value *param_array,
*void user_data) {
xmlrpc_value *message;
xmlrpc_mem_block *output;
char *output_text;
xmlrpc_parse_value(env,param_array,"A",&message);
if(env->fault_occurred)
return(NULL)
// now I want to save this xmlrpc_value 'message'
output = xmlrpc_mem_block_new(env,0);
xmlrpc_serialize_value (env,output,message);
output_text = strdup(XMLRPC_TYPED_MEM_BLOCK_CONTENTS(char, output));
saveToFile(output_text);
free(output_text);
xmlrpc_mem_block_free(output);
return;
}
|