MyGit

meng-tian/async-soap-guzzle

Fork: 18 Star: 95 (更新于 2024-10-26 10:54:50)

license: MIT

Language: PHP .

An asynchronous SOAP client build on top of Guzzle.

最后发布版本: v0.4.1 ( 2022-11-22 06:23:08)

GitHub网址

Asynchronous SOAP client

codecov.io workflow

An asynchronous SOAP client build on top of Guzzle. The SoapClient implements meng-tian/php-async-soap.

Requirement

PHP 7.1 --enablelibxml --enable-soap

Install

composer require meng-tian/async-soap-guzzle

Usage

From v0.4.0 or newer, an instance of Psr\Http\Message\RequestFactoryInterface and an instance of Psr\Http\Message\StreamFactoryInterface need to be injected into Meng\AsyncSoap\Guzzle\Factory. These two interfaces are defined in PSR-17 to create PSR-7 compliant HTTP instances. This change will decouple this library from any specific implementation of PSR-7 and PSR-17. Clients can determine which implementation of PSR-17 they want to use. Plenty of different implementations of PSR17 can be found from Packagist, e.g., symfony/psr-http-message-bridge, or laminas/laminas-diactoros.

  1. Require this library and an implementation of PSR-17 in your composer.json:
...
    "require": {
        "php": ">=7.1.0",
        "meng-tian/async-soap-guzzle": "~0.4.0",
        "laminas/laminas-diactoros": "^2.0"  # this can be replaced by any implementation of PSR-17
    },
...
  1. Run composer install

  2. 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();

License

This library is released under MIT license.

最近版本更新:(数据更新于 2024-10-23 13:05:19)

2022-11-22 06:23:08 v0.4.1

2021-03-28 22:29:03 v0.4.0

2021-03-28 22:18:43 v0.3.0

2019-02-21 03:46:03 v0.2.5

2016-12-04 00:59:53 v0.2.4

2016-06-21 17:38:26 v0.2.3

2016-04-25 15:56:44 v0.2.2

2016-04-22 06:30:31 v0.2.1

2016-04-19 07:14:34 v0.2.0

2016-04-04 04:40:23 v0.1.0

主题(topics):

asynchronous, guzzle, php, soap

meng-tian/async-soap-guzzle同语言 PHP最近更新仓库

2024-11-01 18:37:36 schmittjoh/JMSSerializerBundle

2024-10-31 21:37:53 filamentphp/filament

2024-10-28 00:16:41 symfony/var-dumper

2024-10-28 00:11:41 symfony/symfony

2024-10-11 23:44:26 coollabsio/coolify

2024-10-11 03:27:29 odan/slim4-skeleton