Per la richiesta serialzazione dei parametri soap devi scaricare ed includere nello script la classe nusoap.php del modulo di openmeetings, accessibile da: http://openmeetings.googlecode.com/files/openmeetings_moodle_plugin_v02.zip Ricorda di sostituire username e pass di admin, oltre che i dati dell'utente per cui si richiede l'accesso <? $username='nadia'; $firstname='nadia'; $lastname='nadia'; $email=''; require_once('nusoap.php'); $client_userService = new nusoap_client("http://yourserver:yuorport/openmeetings/services/UserService?wsdl", "wsdl"); //$client_userService->setUseCurl(true); $err = $client_userService->getError(); if ($err) { echo '<h2>Constructor error</h2><pre>' . $err . '</pre>'; echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>'; exit(); } $resultSesssion = $client_userService->call('getSession'); if ($client_userService->fault) { echo '<h2>Fault (Expect - The request contains an invalid SOAP body)</h2><pre>'; print_r($result); echo '</pre>'; } else { $err = $client_userService->getError(); if ($err) { echo '<h2>Error2</h2><pre>' . $err . '</pre>'; } else { //echo '<h2>Result</h2><pre>'; print_r($result); echo '</pre>'; $client_userService->session_id = $resultSesssion["return"]["session_id"]; //echo '<h2>Result</h2><pre>'; printf(); echo '</pre>'; $params = array( 'SID' => $client_userService->session_id, 'username' => 'admin', 'userpass' => admin' ); //$params = array(); $result = $client_userService->call('loginUser',$params); //echo '<h2>Params</h2><pre>'; print_r($params); echo '</pre>'; if ($client_userService->fault) { echo '<h2>Fault (Expect - The request contains an invalid SOAP body)</h2><pre>'; print_r($result); echo '</pre>'; } else { $err = $client_userService->getError(); if ($err) { echo '<h2>Error</h2><pre>' . $err . '</pre>'; } else { } } } } $params = array( 'SID' => $client_userService->session_id, 'username' => $username, 'firstname' => $firstname, 'lastname' => $lastname, 'profilePictureUrl' => '', 'email' => 'nadia@nadia.it' ); $resultO = $client_userService->call('setUserObject',$params); if ($client_userService->fault) { echo '<h2>Fault (Expect - The request contains an invalid SOAP body)</h2><pre>'; print_r($result); echo '</pre>'; } else { $err = $client_userService->getError(); if ($err) { echo '<h2>Error</h2><pre>' . $err . '</pre>'; } else { print_r($resultO); ?> <iframe name="openmeetings" id="openmeetings" title="Openmeetings" frameborder="1" scrolling="auto" src="http://yourserver:yuorport/openmeetings/main.lzx.lzr=swf8.swf?roomid=1&sid=<?php echo $client_userService->session_id;?>" height="700" width="90%" align="center" style="border:thin white solid; align:center;" allowautotransparency="true"></iframe> <? } /* $param = array ('SID' => $client_userService->session_id, 'errorid' => $resultO['result'], 'language_id' => 4); $getErrorByCode = $client_userService2->call('getErrorByCode',$params); echo "<hr>"; var_dump($getErrorByCode);*/ } ?> |