PHP code example of uhi67 / yii2-soap-server

1. Go to this page and download the library: Download uhi67/yii2-soap-server library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

uhi67 / yii2-soap-server example snippets


namespace app\controllers;

class SiteController extends \yii\web\Controller
{
    public function actions()
    {
        return [
            'soap' => [
                'class' => 'conquer\services\WebServiceAction',
                'classMap' => [
                    'MyClass' => 'app\controllers\MyClass'
                ],
            ],
        ];
    }
    /**
     * @param \app\controllers\MyClass $myClass
     * @return string
     * @soap
     */
    public function soapTest($myClass)
    {
        return get_class($myClass);
    }
}

/**
* Class MyClass
 * @soap
 */
class MyClass
{
    /**
     * @var string
     * @soap
     */
    public $name;
}

$ php composer.phar