ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
dummy_client.php
Go to the documentation of this file.
1 <?php
2 
4 
5 //
6 // PART 3: Test it the normal way
7 //
8 
9 include_once("./include/nusoap.php");
10 //include_once ("./include/class.ilXmlWriter.php");
11 
12 $server = $_GET["server"]
13  ? $_GET["server"]
14  : "http://www.ilias.de/lt4el/Services/SOAPAuth/dummy_server.php";
15 
16 $ext_uid = $_GET["ext_uid"]
17  ? $_GET["ext_uid"]
18  : "testuser";
19 
20 $soap_pw = $_GET["soap_pw"]
21  ? $_GET["soap_pw"]
22  : "testpw";
23 
24 $new_user = $_GET["new_user"];
25 
26 echo '<form>' .
27  'server <input size="80" type="text" name="server" "value="' . $server . '"/>' .
28  '<br />ext_uid <input size="50" type="text" name="ext_uid" "value="' . $ext_uid . '"/>' .
29  '<br />soap_pw <input size="50" type="text" name="soap_pw" "value="' . $soap_pw . '"/>' .
30  '<br />new_user <input size="50" type="text" name="new_user" "value="' . $new_user . '"/> (1 for true, 0 for false)' .
31  '<br /><input type="submit" /><br />' .
32  '<b>The test server will return true/valid, if ext_uid == soap_pw.</b>' .
33  '</form>';
34 
35 echo "<br /><br />----------------------------------------------<br /><br /> Calling Server...";
36 
37 // initialize soap client
39 if ($err = $client->getError()) {
40  echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
41 }
42 
43 
44 // isValidSession call
45 //$valid = $client->call('isValidSession',
46 // array('ext_uid' => $ext_uid,
47 // 'soap_pw' => $soap_pw,
48 // 'new_user' => $new_user));
49 
50 $namespace = "http://testuri.org";
51 
52 $valid = $client->call(
53  'isValidSession',
54  array('ns1:ext_uid' => $ext_uid,
55  'ns1:soap_pw' => $soap_pw,
56  'ns1:new_user' => $new_user),
57  $namespace,
58  $namespace . "/isValidSession"
59 );
60 
61 showResult($client, $valid, 'isValidSession');
62 
63 echo "<br />End Test";
64 
66 {
67  if ($client->fault) {
68  echo '<h2>Fault</h2><pre>';
69  print_r($data);
70  echo '</pre>';
71  } else {
72  // Check for errors
73  $err = $client->getError();
74  if ($err) {
75  // Display the error
76  echo '<h2>Error</h2><pre>' . $err . '</pre>';
77  exit;
78  } else {
79  // Display the result
80  echo '<h2>Result ' . $message . '</h2><pre>';
81  print_r($data ? $data : 'FAILED');
82  echo '</pre>';
83  }
84  }
85 }
if($err=$client->getError()) $namespace
$_GET["client_id"]
$valid
$ext_uid
soapclient higher level class for easy usage.
Definition: nusoap.php:4968
$client
catch(Exception $e) $message
$soap_pw
exit
Definition: dummy_client.php:3
$new_user
$server
showResult(&$client, $data, $message)
$data
Definition: bench.php:6