traffaret / amphp-async-soap
Async soap requests with amphp
Installs: 1 781
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 2
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-11-03 19:39:45 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')]);