meng-tian / async-soap-guzzle
An asynchronous SOAP client build on top of Guzzle.
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.9
- meng-tian/php-async-soap: ^1.1
- meng-tian/soap-http-binding: ^0.4.2
- psr/http-factory: ^1.1
Requires (Dev)
- laminas/laminas-diactoros: ^3.8
- phpunit/phpunit: ^11.5
This package is not auto-updated.
Last update: 2026-07-08 07:28:03 UTC
README
An asynchronous SOAP client built on top of Guzzle. SoapClient implements
meng-tian/php-async-soap.
Requirements
PHP 8.2 or newer with ext-soap, and Guzzle 7. PHP 7.x and PHP 8.0-8.1 remain
available only through older releases.
Install
composer require meng-tian/async-soap-guzzle:^0.4.2
Usage
Meng\AsyncSoap\Guzzle\Factory requires a
Psr\Http\Message\RequestFactoryInterface and a
Psr\Http\Message\StreamFactoryInterface. These are
PSR-17 factories for creating
PSR-7 HTTP messages. Use any PSR-17
implementation; the examples below use laminas/laminas-diactoros.
- Install a PSR-17 implementation if your application does not already provide one:
... "require": { "php": "^8.2", "meng-tian/async-soap-guzzle": "^0.4.2", "laminas/laminas-diactoros": "^3.8" }, ...
You can replace laminas/laminas-diactoros with another PSR-17
implementation.
-
Run
composer install -
Create your async SOAP client and call your SOAP messages:
use GuzzleHttp\Client; use Meng\AsyncSoap\Guzzle\Factory; use Laminas\Diactoros\RequestFactory; use Laminas\Diactoros\StreamFactory; $factory = new Factory(); $client = $factory->create( new Client(), new StreamFactory(), new RequestFactory(), 'http://www.webservicex.net/Statistics.asmx?WSDL' ); // Async call $promise = $client->callAsync('GetStatistics', [['X' => [1,2,3]]]); $result = $promise->wait(); // Sync call $result = $client->call('GetStatistics', [['X' => [1,2,3]]]); // Magic method $promise = $client->GetStatistics(['X' => [1,2,3]]); $result = $promise->wait();
Testing
composer install vendor/bin/phpunit
License
This library is released under MIT license.