PHP code example of monosize / soap-proxy

1. Go to this page and download the library: Download monosize/soap-proxy library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

monosize / soap-proxy example snippets


use MonoSize\SoapProxy\SoapProxy;
use Monolog\Logger;
use Monolog\Handler\RotatingFileHandler;

$projectRoot = dirname(__DIR__);
$envPath = $projectRoot;
$cacheDir = $projectRoot . '/var/cache/wsdl';
$logFile = $projectRoot . '/var/log/soap-proxy.log';

// Create logger with file rotation
$logger = new Logger('soap-proxy');
$logger->pushHandler(new RotatingFileHandler(
    $logFile,
    30
));

// Create a proxy from environment variables
// Log level will be automatically set based on PROXYDEBUG environment variable
$proxy = SoapProxy::createFromEnv($logger, $cacheDir, $envPath);

// Process request
$proxy->handle();