nox-it/yii2-soap-client

该软件包已被放弃,不再维护。未建议替代软件包。

Yii2 HTTP SOAP 客户端

2.0.0 2020-05-02 01:13 UTC

This package is auto-updated.

Last update: 2022-06-01 20:11:56 UTC


README

Yii2 组件,用于 SOAP 请求。

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads composer.lock

安装

安装此扩展的首选方法是使用 composer

  • 可以运行
php composer.phar require --prefer-dist "nyx-solutions/yii2-soap-client" "*"

或添加

"nyx-solutions/yii2-soap-client": "*"

到您的应用程序的 composer.json 文件的 require 部分。

使用方法

  • 在您的应用程序配置文件中配置 HttpSoapClient 组件,例如
'components' => [
    'soapApi' => [
        'class'    => 'nyx\http\soap\HttpSoapClient',
        'endpoint' => 'http://ws.exemple.com/WebService.asmx?wsdl',
        'options'  => [
            'cache_wsdl' => WSDL_CACHE_NONE
        ]
    ]
]

或者您可以直接在代码中定义 HttpSoapClient

use nyx\http\soap\HttpSoapClient;

$client = new HttpSoapClient(['endpoint' => 'http://ws.exemple.com/WebService.asmx?wsdl']);

配置步骤完成后,您可以按照以下方式调用 SOAP 方法(其中 getMessage 是您的 SOAP 方法)

echo $client->getMessage('Lorem ipsum...');

许可证

yii2-soap-client 根据 BSD 3-Clause 许可证发布。有关详细信息,请参阅附带的 LICENSE.md 文件。

Yii2