<?php

require_once '../server/common.php';
use Ministra\Lib\w13ec15f0067ea75861e61e27c990e4ba\k8281faec2a4a41f470b00112682ddabf;
if (!\Ministra\Lib\w13ec15f0067ea75861e61e27c990e4ba\k8281faec2a4a41f470b00112682ddabf::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();
}
