send($msg); if (!$resp) { return false; } if (!$resp->faultCode()) { $val = $resp->value(); $data = XML_RPC_decode($val); return $data; } else { return false; } } function xmlrpc_create_project($session, $name) { global $origo_server; require_once 'XML/RPC.php'; $params = array( new XML_RPC_Value($session, 'string'), new XML_RPC_Value($name, 'string'), new XML_RPC_Value('my local test project', 'string'), new XML_RPC_Value('', 'string'), // TODO: Enter the name of an Origo user with administrative rights. new XML_RPC_Value(2, 'int'), new XML_RPC_Value(1, 'int'), new XML_RPC_Value(2, 'int') ); $msg = new XML_RPC_Message('project.add', $params); $cli = new XML_RPC_Client('/api/xmlrpc', $origo_server); $resp = $cli->send($msg); if (!$resp) { return false; } if (!$resp->faultCode()) { $val = $resp->value(); $data = XML_RPC_decode($val); return $data; } else { return $resp->faultString(); } } $session = xmlrpc_login($origo_user, $origo_password); print_r(xmlrpc_create_project($session, $project)); print("\n"); ?>