<?php require_once '../../../conf/config.php'; header("content-type: text/plain"); $clause = array(array('connector' => '', 'subject' => 'Title', 'predicate' => '~', 'object' => 'mord')); $order = array('Title' => 'asc'); try { $client = new SoapClient(HKGMEDIALIB_WSDL_BASEDIR . '/Auth.wsdl'); //$client = new SoapClient('http://media1.hgkz.ch/winet-backend/soap/wsdl/HgkMediaLib_Authentication.wsdl'); echo "we call getSession('user', 'pwd', 'domain') - Returns a new session id:\n"; echo "*******************************************\n\n"; $session = $client->getSession('user', 'pwd', 'domain'); var_export($session); echo "\n"; echo "\n"; echo HKGMEDIALIB_WSDL_BASEDIR . 'Read.wsdl'; $client = new SoapClient(HKGMEDIALIB_WSDL_BASEDIR . 'Read.wsdl'); //$client = new SoapClient('http://media1.hgkz.ch/winet-backend/soap/wsdl/HgkMediaLib_Reading.wsdl'); echo "Functions available:\n"; echo "********************\n"; var_export($client->__getFunctions()); echo "\n\n"; echo "we get the following server:\n"; echo "****************************\n\n"; var_export($client); echo "\n\n"; echo "we call the getSuggestions():\n"; echo "*****************************\n\n"; $result = $client->getSuggestions($session, "title"); var_export($result); echo "\n\n";
public function getsession() { include_once 'WsseAuthHeader.php'; $wsse_header = new WsseAuthHeader("int_cia_ott_api", "int_cia_ott_api"); $soapClient = new SoapClient("http://" . $this->ip_addr . ":8001/session_manager/SessionManager?WSDL", array('trace' => TRUE)); $soapClient->__setSoapHeaders(array($wsse_header)); //$soapClient->__setSoapHeaders(); //echo "<pre>"; //print_r($soapClient); //echo "</pre>"; try { //$results = $soapClient->__call("ChangePassword", array($soapparams)); //$results = $soapClient->getSession(); $results = $soapClient->getSession(); $this->_sessionid = $results->getSessionReturn; } catch (SoapFault $fault) { echo "<pre>FAULT :\n"; print_r($fault); echo "</pre>"; exit; } // echo "<pre>RESULT :\n"; // @print_r($results); // print "REQUEST :\n" . htmlspecialchars($soapClient->__getLastRequest()) . "\n"; // print "RESPONS :\n" . htmlspecialchars($soapClient->__getLastResponse()) . "\n"; // echo "</pre>"; return $this->_sessionid; }
function getCalleeLink($fromHash, $toHash) { global $link; $fromHash = mysql_real_escape_string($fromHash); $toHash = mysql_real_escape_string($toHash); $callerName = getDisplayName($toHash); $userClient = new SoapClient(OM_SERVER_ADDRESS . '/services/UserService?wsdl'); $roomClient = new SoapClient(OM_SERVER_ADDRESS . '/services/RoomService?wsdl'); $session = $userClient->getSession(); $loginResult = $userClient->loginUser(array('SID' => $session->return->session_id, 'username' => OM_ADMIN_LOGIN, 'userpass' => OM_ADMIN_PASS)); if ($loginResult > 0) { //Successfully logged in, searching for a room, if its created $confs = $roomClient->getRooms(array('SID' => $session->return->session_id, 'start' => 0, 'max' => 100, 'orderby' => 'name', 'asc' => true))->return->result; $roomId = null; foreach ($confs as $value) { if ($value->name == $fromHash . $toHash) { //room exists, returning link to it $roomId = $value->rooms_id; } } if ($roomId == null) { //room doesn't exist, creating one and returning a link $addRoomResult = $roomClient->addRoomWithModeration(array('SID' => $session->return->session_id, 'name' => $fromHash . $toHash, 'roomtypes_id' => 1, 'comment' => 'Call room', 'numberOfPartizipants' => 2, 'ispublic' => true, 'appointment' => false, 'isDemoRoom' => false, 'demoTime' => 0, 'isModeratedRoom' => true))->return; if ($addRoomResult > 0) { $roomId = $addRoomResult; } else { dieWithMessage(METHOD_GETCALLEELINK, 'Failed to add a room'); } } $setUserObjectResult = $userClient->setUserObjectAndGenerateRoomHash(array('SID' => $session->return->session_id, 'username' => $callerName, 'firstname' => $callerName, 'lastname' => '', 'profilePictureUrl' => '', 'email' => '', 'externalUserId' => 0, 'externalUserType' => 'caller', 'room_id' => $roomId, 'becomeModeratorAsInt' => 0, 'showAudioVideoTestAsInt' => 2))->return; if ($setUserObjectResult != null) { showResult(METHOD_GETCALLEELINK, OM_SERVER_ADDRESS . '/openmeetings/main.lzx.swf8.swf?secureHash=' . $setUserObjectResult); } else { dieWithMessage(METHOD_GETCALLEELINK, "Setting user object failed"); } } else { dieWithMessage(METHOD_GETCALLEELINK, "Login failed"); } }
// $wsdl_loc = "http://media1.hgkz.ch/winet-backend/soap/wsdl/HgkMediaLib_MetaDataFeed.wsdl"; /* get a soap session on media1 */ $auth_wsdl_loc = "http://localhost/winet-backend/soap/wsdl/HgkMediaLib_Authentication.wsdl"; session_start(); if (!$_SESSION['HgkMediaLib_Session']) { $auth_client = new SoapClient($auth_wsdl_loc); // $function_list = $auth_client->__getFunctions(); // echo '<pre>function_list:'; // print_r($function_list); // echo '</pre>'; // $type_list = $auth_client->__getTypes(); // echo '<pre>type_list:'; // print_r($type_list); // echo '</pre>'; // exit; $session_id = $auth_client->getSession('test', 'test', 'hgkz'); $_SESSION['HgkMediaLib_Session'] = $session_id; } else { $session_id = $_SESSION['HgkMediaLib_Session']; } $clauses = array(array('connector' => '', 'subject' => 'Titel', 'predicate' => '~', 'object' => 'Mord')); $sort_order = array('Titel' => 'asc'); $limit = ''; $lang = 'de'; } catch (SoapFault $f) { $fault = "SOAP Fehler:<br>faultcode: {$f->faultcode}<br>"; $fault .= "faultstring: {$f->faultstring}<br>"; $fault .= "faultactor: {$f->faultactor}<br>"; $fault .= "faultdetail: {$f->detail}<br>"; die($fault); }