日期:2014-05-16 浏览次数:20727 次
#include <stdio.h> #include <xmlrpc.h> #include <xmlrpc_client.h> void die_if_fault_occurred (xmlrpc_env *env) { /* Check our error-handling environment for an XML-RPC fault. */ if (env->fault_occurred) { fprintf(stderr, "XML-RPC Fault: %s (%d)\n", env->fault_string, env->fault_code); exit(1); } } int main (int argc, char** argv) { xmlrpc_env env; xmlrpc_value *result; xmlrpc_int32 id; /* Start up our XML-RPC client library. */ xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, "XML-RPC user.getidbyname client", "0.1"); xmlrpc_env_init(&env); /* Call our XML-RPC server. */ result = xmlrpc_client_call(&env, "http://10.6.125.253:2600/RPC2", "user.getidbyname", ??????, ????); [color=#FF0000]//这个函数的后面几个参数如何赋值啊?[/color] die_if_fault_occurred(&env); /* Parse our result value. */ xmlrpc_parse_value(&env, result, ?????, ?????, ....); [color=#FF0000]//这里的返回结果如何解析啊?[/color] die_if_fault_occurred(&env); /* Print out result. */ printf("the id is %d\n", (int) id); /* Dispose of our result value. */ xmlrpc_DECREF(result); /* Shutdown our XML-RPC client library. */ xmlrpc_env_clean(&env); xmlrpc_client_cleanup(); return 0; }