<?php
require_once dirname(__DIR__) . '/../common.php';

$soapClient = new SoapClient(SITE_LINK.'shipping_api/aramex/aramex/location_details.wsdl');
echo '<pre>';
	print_r($soapClient->__getFunctions());
$params = array(
    'ClientInfo'  			=> array(
        'AccountCountryCode'	=> 'LB',
        'AccountEntity'		 	=> 'BEY',
        'AccountNumber'		 	=> '131625',
        'AccountPin'		 	=> '543643',
        'UserName'			 	=> 'myrnazein@hotmail.com', // M
        'Password'			 	=> 'Myrna@123456', // M
        'Version'		 	    => 'v1',// M	
    ),
    'Transaction' 			=> array(
        'Reference1'			=> '001',

    ),
    'CountryCode'=>'LB'
);
var_dump($soapClient);
// calling the method and printing results
try {
    // $auth_call = $soapClient->FetchOffices($params);// fetch offices ({Mandatory:'CountryCode' => 'LB'}) 
    // $auth_call = $soapClient->FetchCountries($params);// fetch all countries 
    // $auth_call = $soapClient->FetchCountry($params);// fetch country details ({Mandatory:'Code'=>'LB'})
    $auth_call = $soapClient->FetchCities($params);// fetch cities ({Mandatory:'CountryCode'=>'LB',Optional:'State'=>NULL,Opional:'NameStartsWith'=>'N'});
    // $auth_call = $soapClient->ValidateAddress($params); // check if address is avaliable
    //      'Address' 			    => array(
    //        'Line1'			    => '001',   Mandatory
    //        'Line2'			    => '',      Optional
    //        'Line3'			    => '',      Optional
    //        'City'			    => 'Saida', Mandatory
    //        'StateOrProvinceCode' => '',      Conditional
    //        'PostCode'			=> '400093',Conditional
    //        'CountryCode'			=> 'LB'		Mandatory					 
    //    ); if city name is incorrect return error city doesn't exist else return empty array

    echo '<pre>';
    print_r($auth_call);
    die();

} catch (SoapFault $fault) {
    die('Error : ' . $fault->faultstring);
}
?>