Web service with Yii 2.0

To make simple Web service with Yii 2.0:
1) Download Composer: 
Variant A:
php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php
php composer-setup.php
php -r "unlink('composer-setup.php');"
Variant B:
curl -sS https://getcomposer.org/installer | php
2) Install Composer:
mv composer.phar /usr/local/bin/composer
3) Install Yii:
composer global require "fxp/composer-asset-plugin:~1.1.1"
4) Generate simple Yii 2.0 project:
composer create-project --prefer-dist yiisoft/yii2-app-basic basic
5) Move files from newly created folder basic to your dir.
6) Enter your dir, that now with created Yii project.
7) In my case, we will use http://www.yiiframework.com/extension/yii2-services/ . Run in console
php composer.phar require conquer/services "*"
 8) Edit file controllers/SiteController.php 
8.1) In the class SiteController add two functions:
/**
     @param string $inStr
     * @return string
     * @soap
     */
     public function mySoapTest($inStr)
    {
        return "Hello, ".$inStr." !!!!!!!!!!!!!!!";
    }
    
     /**
     * @param app\controllers\MyClass $myClass
     * @return string
     * @soap
     */
    public function soapTest($myClass)
    {
        return get_class($myClass);
    }
8.2) In the function actions of the SiteController class add to massive, that returned by that function:
'class' => 'conquer\services\WebServiceAction',
                'classMap' => [
                    'MyClass' => 'app\controllers\MyClass'
                ],

public function actions()
    {
        return [
        'soap' => [
                'class' => 'conquer\services\WebServiceAction',
                'classMap' => [
                    'MyClass' => 'app\controllers\MyClass'
                ],
            ],
            'error' => [
                'class' => 'yii\web\ErrorAction',
            ],
            'captcha' => [
                'class' => 'yii\captcha\CaptchaAction',
                'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
            ],
        ];
    }
9) Check, that host name of the site is declared in hosts file. In /etc/hosts must be declared something like
127.0.1.1       srv1.lifesim.biz
 where srv1.lifesim.biz - is your host.
 Otherwise, your app could get error like
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>WSDL</faultcode><faultstring>SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://srv1.lifesim.biz/index.php?r=site%2Fsoap' : failed to load external entity "http://srv1.lifesim.biz/index.php?r=site%2Fsoap"
</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
10)  OK, service is done. Write simple programm, for example, in C# and try your new PHP Yii 2.0 Web service. 
Example of the my C# programm:
using myprogramm.mws;
using System;
using System.Collections.Generic;
using System.Text;

namespace myprogramm
{
    class Program
    {
        static void Main(string[] args)
        {
            try {
                MyClass mc = new MyClass();
                SiteControllerService s = new SiteControllerService();
                Console.WriteLine(s.soapTest(mc));
                Console.WriteLine(s.mySoapTest ("QWE!"));
            } catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
    }
}
 Run it.
11) Example output of that programm, if all configured well:
app\controllers\MyClass
Hello, QWE! !!!!!!!!!!!!!!!