• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Services/SOAPAuth/dummy_client.php

Go to the documentation of this file.
00001 <?php
00002 
00003 exit;
00004 
00005 //
00006 // PART 3: Test it the normal way
00007 //
00008 
00009 include_once ("./include/nusoap.php");
00010 //include_once ("./include/class.ilXmlWriter.php");
00011 
00012 $server = $_GET["server"]
00013         ? $_GET["server"]
00014         : "http://www.ilias.de/lt4el/Services/SOAPAuth/dummy_server.php";
00015         
00016 $ext_uid = $_GET["ext_uid"]
00017         ? $_GET["ext_uid"]
00018         : "testuser";
00019 
00020 $soap_pw = $_GET["soap_pw"]
00021         ? $_GET["soap_pw"]
00022         : "testpw";
00023 
00024 $new_user = $_GET["new_user"];
00025 
00026 echo '<form>'.
00027         'server <input size="80" type="text" name="server" "value="'.$server.'"/>'.
00028         '<br />ext_uid <input size="50" type="text" name="ext_uid" "value="'.$ext_uid.'"/>'.
00029         '<br />soap_pw <input size="50" type="text" name="soap_pw" "value="'.$soap_pw.'"/>'.
00030         '<br />new_user <input size="50" type="text" name="new_user" "value="'.$new_user.'"/> (1 for true, 0 for false)'.
00031         '<br /><input type="submit" /><br />'.
00032         '<b>The test server will return true/valid, if ext_uid == soap_pw.</b>'.
00033         '</form>';
00034 
00035 echo "<br /><br />----------------------------------------------<br /><br /> Calling Server...";
00036 
00037 // initialize soap client
00038 $client = new soap_client($server);
00039 if ($err = $client->getError()) 
00040 {
00041         echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
00042 }
00043 
00044 
00045 // isValidSession call
00046 //$valid = $client->call('isValidSession',
00047 //              array('ext_uid' => $ext_uid,
00048 //                      'soap_pw' => $soap_pw,
00049 //                      'new_user' => $new_user));
00050 
00051 $namespace = "http://testuri.org";
00052 
00053 $valid = $client->call('isValidSession',
00054                 array('ns1:ext_uid' => $ext_uid,
00055                         'ns1:soap_pw' => $soap_pw,
00056                         'ns1:new_user' => $new_user), $namespace,
00057                         $namespace."/isValidSession");
00058 
00059 showResult($client,$valid,'isValidSession');
00060 
00061 echo "<br />End Test";
00062 
00063 function showResult(&$client,$data,$message)
00064 {
00065         if($client->fault) {
00066                 echo '<h2>Fault</h2><pre>';
00067                 print_r($data);
00068                 echo '</pre>';
00069         }
00070         else 
00071         {
00072                 // Check for errors
00073                 $err = $client->getError();
00074                 if ($err) {
00075                         // Display the error
00076                         echo '<h2>Error</h2><pre>' . $err . '</pre>';
00077                         exit;
00078                 } else {
00079                         // Display the result
00080                         echo '<h2>Result '.$message.'</h2><pre>';
00081                         print_r($data ? $data : 'FAILED');
00082                         echo '</pre>';
00083                 }
00084         }
00085 }
00086 
00087 ?>

Generated on Fri Dec 13 2013 13:52:12 for ILIAS Release_3_7_x_branch .rev 46817 by  doxygen 1.7.1