Yii2 component for SOAP requests.
The preferred way to install this extension is through composer.
- Either run
php composer.phar require --prefer-dist "nox-it/yii2-soap-client" "*"
or add
"nox-it/yii2-soap-client": "*"
to the require
section of your application's composer.json
file.
- Configure the
HttpSoapClient
component in your application's configuration file, for example:
'components' => [
'soapApi' => [
'class' => 'nox\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 nox\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...');
yii2-soap-client is released under the BSD 3-Clause License. See the bundled LICENSE.md
for details.