nyx-solutions/yii2-http-soap-client

Yii2 HTTP SOAP Client

5.0.0 2022-06-02 14:59 UTC

This package is auto-updated.

Last update: 2024-11-30 02:16:26 UTC


README

Yii2 component for SOAP requests.

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads composer.lock

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.

Yii2