Created
February 14, 2014 12:37
-
-
Save wowo/9000295 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* $Id$ */ | |
set_include_path(get_include_path() . ':' . __DIR__ . '/../lib'); | |
include 'SabreAMF/Client.php'; //Include the client scripts | |
spl_autoload_register(function($classname) { | |
$filename = str_replace(array('_', '\\'), DIRECTORY_SEPARATOR, $classname) . '.php'; | |
include $filename; | |
}); | |
$client = new SabreAMF_Client('http://manager4.katheroine.xsdev.pl/gateway.php'); | |
$isAuthenticated = $client->sendRequest('com.agnitio.amf.authentication.AuthenticationService.authenticate', array('erika.castillo@roche.com', md5('test'))); | |
if (!$isAuthenticated) { | |
throw new \Exception('Not authenticated...'); | |
} | |
$phpSessionId = $client->amfResponse->getHeaders()[0]['data']; | |
$client = new SabreAMF_Client('http://manager4.katheroine.xsdev.pl/gateway.php' . $phpSessionId); // session!!! | |
$result = $client->sendRequest('com.agnitio.amf.company.CompanyService.getCountryList', array()); | |
var_dump($result); //Dump the results |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment