penblu / soap
由 PenBlu 创建的扩展,用于使用由 subdee/yii2-soap-server 创建的 SOAP 服务器库
1.0.0
2020-04-03 05:24 UTC
Requires
This package is auto-updated.
Last update: 2024-09-29 05:36:15 UTC
README
基于 Yii 1 框架实现的 Yii 2 SOAP 服务器。
此扩展是对 Yii1 中可用的 SOAP Web 服务进行适配,以兼容 Yii2。它包含 v1.1.15 版本中的所有功能。
注意:随着 Yii2 的进步,某些功能可能无法正常工作,但我会尽最大努力保持更新。
参考:https://github.com/subdee/yii2-soap-server
需求
安装
使用 composer 并在您的 composer.json 文件中添加以下行
"penblu/yii-soap": "*"
用法
用法类似于 Yii 指南 中的说明
在您的控制器中定义自定义操作
public function actions() { return [ ..., 'myService' => [ 'class' => 'penblu\soapserver\SoapAction', ], ..., ]; }
将 @soap
关键字添加到正确文档化的操作中
/** * Returns hello and the name that you gave * * @param string $name Your name * @return string * @soap */ public function getHello($name) { return 'Hello ' . $name; }
此外,请记住通过设置其属性来关闭控制器的 CSRF 验证
public $enableCsrfValidation = false;