traff-ik / amphp-async-soap
This package is abandoned and no longer maintained.
The author suggests using the traffaret/amphp-async-soap package instead.
Async soap requests with amphp
v1.0.1
2020-11-16 20:38 UTC
Requires
- php: >=7.3
- ext-soap: *
- amphp/http-client: ^4.3
Requires (Dev)
- amphp/phpunit-util: ^1.4
- mockery/mockery: ^1.4
- phpunit/phpunit: ^9.4
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2024-04-03 18:07:20 UTC
README
async-soap
Amphp soap async
use Amp\Http\Client\HttpClientBuilder; use Traff\Soap\Options; use Traff\Soap\SoapTransportBuilder; use Traff\Soap\Wsdl\WsdlUrlFactory; $http_client = HttpClientBuilder::buildDefault(); $options = (new Options()) ->withSoapVersion(\SOAP_1_1) ->withConnectionTimeout(20); $wsdl = yield (new WsdlUrlFactory()) ->createWsdl('https://cbr.ru/DailyInfoWebServ/DailyInfo.asmx?WSDL', null, $http_client) ->toString(); $soap_transport = (new SoapTransportBuilder()) ->withHttpClient($http_client) ->withWsdl($wsdl) ->withOptions($options) ->build(); $result = yield $soap_transport->callAsync('GetCursOnDate', [['On_date' => (new \DateTime('now'))->format('Y-m-d')]]); // Or $result = yield $soap_transport->GetCursOnDate(['On_date' => (new \DateTime('now'))->format('Y-m-d')]);