Skip to content

Instantly share code, notes, and snippets.

@wowo
Created February 14, 2014 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wowo/9000295 to your computer and use it in GitHub Desktop.
Save wowo/9000295 to your computer and use it in GitHub Desktop.
<?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