PHP code example of michalkortas / webservicentlm

1. Go to this page and download the library: Download michalkortas/webservicentlm 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/ */

    

michalkortas / webservicentlm example snippets


michalkortas\WebserviceNtlm\WebserviceNtlmProvider::class

'NtlmSoapService' => michalkortas\WebserviceNtlm\Services\NtlmSoapService::class

NTLM_DOMAIN="domain"
NTLM_USER="user"
NTLM_PASSWORD="password"

$client = NtlmSoapService::initClient('https://your_webservice_url');
$data = $client->webserviceMethod();

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',
    ],
];

$client = NtlmSoapService::initClient('https://other_webservice_url', 'other_credentials');
$data = $client->webserviceMethod();

$client = NtlmSoapService::initClient('https://your_webservice_url');

$header = new \SoapHeader( 'http://schemas.xmlsoap.org/soap/envelope/', 'Header');
$client->__setSoapHeaders($header);

$data = $client->webserviceMethod();

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