2017 © Pedro Peláez
 

yii2-extension yii2-soap

Yii2 wrapper for default SoapClient

image

nhkey/yii2-soap

Yii2 wrapper for default SoapClient

  • Tuesday, January 31, 2017
  • by nhkey
  • Repository
  • 3 Watchers
  • 2 Stars
  • 618 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 2 Versions
  • 36 % Grown

The README.md

Yii2 SOAP Client

This extension is wrapper for default SoapClient in PHP., (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require nhkey/yii2-soap "*"

or add, (*4)

"nhkey/yii2-soap": "*"

to the require section of your composer.json., (*5)

Usage

You need add this extension in your config file in the 'components' section, (*6)

'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.:, (*7)

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, (*8)

Email: mail@mikhailmikhalev.ru, (*9)

The Versions

31/01 2017

dev-master

9999999-dev

Yii2 wrapper for default SoapClient

  Sources   Download

MIT License

The Requires

 

by Mikhail Mikhalev

component yii2 soap

23/08 2016

1.0

1.0.0.0

Yii2 wrapper for default SoapClient

  Sources   Download

MIT License

The Requires

 

by Mikhail Mikhalev

component yii2 soap