<?php

require_once '../server/common.php';
use Ministra\Lib\bd5c9022e9a9029209e5fd05775ea272\K131970f0a776522b1a53ba419cd5e32c;
if (!\Ministra\Lib\bd5c9022e9a9029209e5fd05775ea272\K131970f0a776522b1a53ba419cd5e32c::getSafe('enable_soap_api', \false)) {
    \header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');
    echo 'SOAP API is not enabled';
    exit;
}
require_once __DIR__ . '/../vendor/rock/phpwsdl/src/Rock/PhpWsdl/class.phpwsdl.php';
use Ministra\Lib\SOAPApi\v1\SoapApiServer;
$api_server = new \Ministra\Lib\SOAPApi\v1\SoapApiServer();
if (isset($_GET['wsdl'])) {
    $api_server->outputWsdl();
} elseif (isset($_GET['docs'])) {
    $api_server->outputDocs();
} elseif (isset($_GET['phpsoapclient'])) {
    $api_server->outputPhpClient();
} else {
    $api_server->handleRequest();
}
