1<?php
2
3ini_set('display_erros', 1);
4error_reporting(E_ALL);
5require_once __DIR__ . "/lib/ohrmWebServiceClient.php";
6session_start();
7
8$baseURL = 'http://localhost/ent412Trunk/symfony/web/';
9
10//
11// Create client.
12//
13$client = new ohrmWebServiceClient($baseURL);
14
15//
16// You should first add an oAuth client with the given credentials using
17// the url: /admin/registerOAuthClient
18//
19$client->setCredentials("demoapp", "demopass");
20
21// Use token if available
22if (isset($_SESSION['access_token'])) {
23	$client->setToken($_SESSION['access_token']);
24}
25
26$methodUrl = '/bulkUpdateUsers';
27$users = array(array('userName' => 'ashley14', 'passWord' => 'ssss', 'type' => 2, 'userId' => 47),
28        array('userName' => 'ashley1478', 'passWord' => 'ssss', 'type' => 2, 'userId' => 50));
29$parameters = array('users' => $users);
30
31$results = $client->callMethod($methodUrl, 'POST', $parameters);
32var_dump($results);
33