yii-diandi / yii2-soap-client
SOAP Client Extension for Yii 2
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Type:yii2-extension
Requires
- php: >=5.4.0
- ext-soap: *
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-10-22 10:34:04 UTC
README
Note, PHP SOAP extension is required.
Installation
The preferred way to install this extension is through composer.
Either run
composer require --prefer-dist yii-diandi/yii2-soap-client "*"
or add
"diandi/yii2-soap-client": "*"
to the require
section of your composer.json
file.
Usage
You need to setup soap client application component:
'components' => [ 'siteApi' => [ 'class' => 'diandi\soapclient\Client', 'url' => 'http://myservice.com/api/hello', 'options' => [ 'cache_wsdl' => WSDL_CACHE_NONE, ], ] ... ]
or define the client directly in the code:
$client = new \diandi\soapclient\Client([ 'url' => 'http://myservice.com/api/hello', ]);
Example of calling the SOAP function:
$client = Yii::$app->siteApi; echo $client->getHello('Alex');