nyx-solutions / yii2-http-soap-client
Yii2 HTTP SOAP Client
5.0.0
2022-06-02 14:59 UTC
Requires
- php: >=8.1.0 <8.2
- ext-soap: *
- nyx-solutions/yii2-nyx: ~5.0.0
- nyx-solutions/yii2-nyx-helpers: ~5.0.0
README
Yii2 component for SOAP requests.
Installation
The preferred way to install this extension is through composer.
- Either run
php composer.phar require --prefer-dist "nyx-solutions/yii2-http-soap-client" "*"
or add
"nyx-solutions/yii2-http-soap-client": "*"
to the require
section of your application's composer.json
file.
Usage
- Configure the
HttpSoapClient
component in your application's configuration file, for example:
'components' => [ 'soapApi' => [ 'class' => 'nyx\http\soap\HttpSoapClient', 'endpoint' => 'http://ws.exemple.com/WebService.asmx?wsdl', 'options' => [ 'cache_wsdl' => WSDL_CACHE_NONE ] ] ]
Or you can define the HttpSoapClient
directly in your code:
use nyx\http\soap\HttpSoapClient; $client = new HttpSoapClient(['endpoint' => 'http://ws.exemple.com/WebService.asmx?wsdl']);
After the configuration step is compleate, you can call the SOAP methods as follow (where getMessage
is your SOAP method):
echo $client->getMessage('Lorem ipsum...');
License
yii2-http-soap-client is released under the BSD 3-Clause License. See the bundled LICENSE.md
for details.