定制 michalkortas/webservicentlm 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

michalkortas/webservicentlm

最新稳定版本:1.0.0

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());

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固