Код: Выделить всё
ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache
date_default_timezone_set('America/Denver');
$output = array();
$UserName = 'myusername';
$Password = 'mypassword';
$WSDL = 'https://onlineavl2api-us.navmanwireless.com/onlineavl/api/V1.9/service.asmx?WSDL';
$URL = 'https://onlineavl2api-us.navmanwireless.com/onlineavl/api/V1.9/service.asmx';
$client = new SoapClient($WSDL, array('trace' => 1, 'encoding' => 'UTF-8'));
$client->__setLocation($URL);
$GUID = getGUID(); // I have a separate function for creating GUID with PHP i can post if needed
$UserInfo = array(
'request' => array(
'SessionID' => null,
'UserCredential' => array(
'UserName' => $UserName,
'Password' => $Password,
'ApplicationID' => $GUID,
'ClientID' => $GUID,
'ClientVersion' => '1.2'
),
'IPAddress' => $_SERVER['SERVER_ADDR'],
'ClockVerificationUtc' => time()
));
try{
$SessionID = $client->DoLogin($UserInfo);
$AllFunctions = $client->__getFunctions();
$GetTypes = $client->__getTypes();
$LastRequest = $client->__getLastRequest();
$LastResponse = $client->__getLastResponse();
// $SessionID = $client->DoLogin($UserInfo);
}
catch(Exception $e) {
$output['errors'] = $e->getMessage();
}
$output['Types'] = $GetTypes;
$output['Functions'] = $AllFunctions;
$output['result'] = $result;
$output['LastRequest'] = $LastRequest;
$output['LastResponse'] = $LastResponse;
$output['SessionInfo'] = $SessionInfo;
print json_encode($output);
Код: Выделить всё
Server was unable to process request. ---> A service call threw a security fault exception - Security.Fault: SessionIDNotFound ---> Security.Fault: SessionIDNotFound
Подробнее здесь: https://stackoverflow.com/questions/446 ... etup-login
Мобильная версия