Go to the documentation of this file.00001 #include <stdio.h>
00002 #include <xmlrpc-c/client.h>
00003
00004 int main(int const argc, const char ** const argv) {
00005 xmlrpc_env env;
00006 xmlrpc_value * resultP;
00007 int sum;
00008 char * const url = "http://xmlrpc-c.sourceforge.net/api/sample.php";
00009 char * const methodName = "sample.add";
00010
00011
00012 xmlrpc_env_init(&env);
00013
00014 xmlrpc_client_init2(&env, XMLRPC_CLIENT_NO_FLAGS, "Client", "1.0", NULL, 0);
00015
00016 resultP = xmlrpc_client_call(&env, url, methodName, "(ii)", (xmlrpc_int32) 1, (xmlrpc_int32) 2);
00017
00018 xmlrpc_parse_value(&env, resultP, "i", &sum);
00019 printf("The sum is %d\n", sum);
00020
00021 xmlrpc_DECREF(resultP);
00022
00023 xmlrpc_env_clean(&env);
00024
00025 xmlrpc_client_cleanup();
00026 return 0;
00027 }
00028