This is a simple library for consuming webservices soap.
composer require easy-soapclient/easy-soapclient
use EasySoapClient\Client;
use EasySoapClient\Configuration;
$url = 'http://my-webservice.com/webservice.php?WSDL';
$config = new Configuration($url);
$result = (new Client($config))->getClient();
print_r($result->webServiceMethodBar('foo'));
print_r($result->webServiceMethodFoo('bar', 'foo'));
use EasySoapClient\Client;
use EasySoapClient\Configuration;
use EasySoapClient\ProxyOptions;
$url = 'http://my-webservice.com/webservice.php?WSDL';
$proxy = new ProxyOptions('your-proxy-host', 3120, 'user', 'password');
$config = new Configuration($url, $proxy);
$result = (new Client($config))->getClient();
print_r($result->webServiceMethodFoo('foo'));
print_r($result->webServiceMethodBar('bar', 'foo'));
use EasySoapClient\Client;
use EasySoapClient\Configuration;
use EasySoapClient\AuthOptions;
$url = 'http://my-webservice.com/webservice.php?WSDL';
$auth = new AuthOptions('user', 'password');
$config = new Configuration($url, null, $auth);
$result = (new Client($config))->getClient();
print_r($result->webServiceMethodFoo('foo'));
print_r($result->webServiceMethodBar('bar', 'foo'));
The MIT License (MIT). Please see License File for more information.