michalkortas/webservicentlm
Composer 安装命令:
composer require michalkortas/webservicentlm
包简介
Override default SoapClient class to connect webservice with NTLM Windows authentication
README 文档
README
Override default SoapClient class to connect webservice with NTLM Windows authentication
Licence
MIT
Installation via Composer
composer require michalkortas/webservicentlm
Laravel 5.5 and earlier
Register new ServiceProvider in config/app.php
michalkortas\WebserviceNtlm\WebserviceNtlmProvider::class
Register new Alias in config/app.php
'NtlmSoapService' => michalkortas\WebserviceNtlm\Services\NtlmSoapService::class
Usage
Set credentials
Just add to your .enf file:
NTLM_DOMAIN="domain" NTLM_USER="user" NTLM_PASSWORD="password"
Init connection
$client = NtlmSoapService::initClient('https://your_webservice_url'); $data = $client->webserviceMethod();
Change connection
Package use config/ntlmsoapservice.php file to set domain\user credential. If you want to connect to other webservices with other credentials, set new credential type in this file, e.g.:
return [ 'default' => [ 'domain' => env('NTLM_DOMAIN', 'domain'), 'user' => env('NTLM_USER', 'user'), 'password' => env('NTLM_PASSWORD', 'password'), ], 'other_credentials' => [ 'domain' => 'domain2', 'user' => 'user2', 'password' => 'user3', ], ];
Add credential name as second initClient() param:
$client = NtlmSoapService::initClient('https://other_webservice_url', 'other_credentials'); $data = $client->webserviceMethod();
Headers
If you want add some headers to connection, just type:
$client = NtlmSoapService::initClient('https://your_webservice_url'); $header = new \SoapHeader( 'http://schemas.xmlsoap.org/soap/envelope/', 'Header'); $client->__setSoapHeaders($header); $data = $client->webserviceMethod();
Get last request
If you want to show last request (e.g. send XML), check __getLastRequest() method:
$client = NtlmSoapService::initClient('https://your_webservice_url'); $header = new \SoapHeader( 'http://schemas.xmlsoap.org/soap/envelope/', 'Header'); $client->__setSoapHeaders($header); $data = $client->webserviceMethod(); var_dump($client->__getLastRequest());
michalkortas/webservicentlm 适用场景与选型建议
michalkortas/webservicentlm 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18 次下载、GitHub Stars 达 3, 最近一次更新时间为 2020 年 07 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Authentication」 「soap」 「webservice」 「windows」 「domain」 「active directory」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 michalkortas/webservicentlm 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 michalkortas/webservicentlm 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 michalkortas/webservicentlm 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Wrapper around PHP SoapClient class
cURL and cURL based Soap-Client for PHP
A PHP client for the Salesforce SOAP API
Externalize Symfony VarDumper dumps
Automatically logs-in users if they are already authenticated by a remote source. (e.g. environment variable REMOTE_USER)
GraphQL authentication for your headless Craft CMS applications.
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-07-02