Example #1
0
File: apis.php Project: rbello/ent
try {
    $client = new SoapClient('https://ent-rbello.c9.io/api/GestionSessions.wsdl', array("trace" => 1, "exception" => 1));
    $result = @$client->getSessionByID(848037);
    if (!is_object($result)) {
        throw new \Exception('Result is not an object');
    }
    if (!isset($result->id) || $result->id !== 848037) {
        throw new \Exception('Field access error');
    }
} catch (\Exception $ex) {
    echo "Error: SOAP call GestionSessions::getSessionByID() -> {$ex->getMessage()}\n";
} finally {
    unset($result);
}
try {
    $result = @$client->getSessionsByRacineEtablissementAndYear('TL', 2014);
    if (!is_array($result)) {
        throw new \Exception('Result is not an array');
    }
    if (sizeof($result) != 7) {
        throw new \Exception('Expected 7 results');
    }
} catch (\Exception $ex) {
    echo "Error: SOAP call GestionSessions::getSessionsByRacineEtablissementAndYear() -> {$ex->getMessage()}\n";
} finally {
    unset($client, $result);
}
if (@(!file_get_contents('https://ent-rbello.c9.io/'))) {
    echo "Error: WWW /index.html\n";
}
if (@(!file_get_contents('https://ent-rbello.c9.io/css/style.css'))) {