PHP code example of mongosoft / yii2-soap-server
1. Go to this page and download the library: Download mongosoft/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/ */
mongosoft / yii2-soap-server example snippets
class ApiController extends Controller
{
/**
* @inheritdoc
*/
public function actions()
{
return [
'hello' => 'mongosoft\soapserver\Action',
];
}
/**
* @param string $name
* @return string
* @soap
*/
public function getHello($name)
{
return 'Hello ' . $name;
}
}
/**
* @inheritdoc
*/
public function actions()
{
return [
'index' => [
'class' => 'mongosoft\soapserver\Action',
'serviceOptions' => [
'disableWsdlMode' => true,
]
]
];
}