nhkey/yii2-soap
最新稳定版本:1.0
Composer 安装命令:
composer require nhkey/yii2-soap
包简介
Yii2 wrapper for default SoapClient
关键字:
README 文档
README
This extension is wrapper for default SoapClient in PHP.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require nhkey/yii2-soap "*"
or add
"nhkey/yii2-soap": "*"
to the require section of your composer.json.
Usage
You need add this extension in your config file in the 'components' section
'components' => [ 'soapClient' => [ 'class' => \nhkey\soap\SoapClientWrapper::className(), 'url' => '<SOAP_WSDL_URL>', // SoapClient options 'options' => [ 'cache_wsdl' => WSDL_CACHE_NONE, 'debug' => true, ], // SopaClient headers, object or closure 'headers' => function() { $headers = new stdClass(); $headers->authDetails = new stdClass(); // This is node in SOAP Header where the login and password. $headers->authDetails->login = 'LOGIN'; $headers->authDetails->password = 'PASSWORD'; return $headers; } ], ... ]
Now you can use this extension, e.g.:
try { $soap = Yii::$app->soapClient; $result = $soap->makeSmb(['arg1' => 'foo', 'arg2' => 'bar']); } catch (SoapClientWrapperException $e) { return ['request' => $soap->getLastRequest(), 'response' => $soap->getLastResponse()]; }
Credits
Author: Mikhail Mikhalev
Email: mail@mikhailmikhalev.ru
统计信息
- 总下载量: 11.83k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-08-23