<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);

$_SERVER['DOCUMENT_ROOT'] = 'c:/Users/light/sam/5130';

require_once 'c:/Users/light/sam/5130/eaccount/api/barobill_account_config.php';

echo "1. SoapClient Check:\n";
if (class_exists('SoapClient')) {
    echo "SoaptClient is available.\n";
} else {
    echo "SoapClient is NOT available.\n";
}

echo "\n2. Global Client Check:\n";
global $barobillAccountSoapClient;
if ($barobillAccountSoapClient) {
    echo "Global \$barobillAccountSoapClient is initialized.\n";
} else {
    echo "Global \$barobillAccountSoapClient is NULL.\n";
    global $barobillInitError;
    echo "Init Error: $barobillInitError\n";
}

echo "\n3. Call GetBankAccountEx:\n";
$result = callBarobillAccountSOAP('GetBankAccountEx', ['AvailOnly' => 0]);

echo "Result Success: " . ($result['success'] ? 'Yes' : 'No') . "\n";
if (!$result['success']) {
    echo "Error: " . $result['error'] . "\n";
} else {
    echo "Data Type: " . gettype($result['data']) . "\n";
    print_r($result['data']);
}
?>
