PHP code example of theiconic / ntlm-soap

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

    

theiconic / ntlm-soap example snippets




use TheIconic\NtlmSoap\Client\NtlmSoap;
use GuzzleHttp\Client;

$client = new Client();

$soapClient = new NtlmSoap(
    $client,
    null,
    [
        'username' => 'your-username',
        'password' => 'your-password',
        'wsdl' => 'path-of-your-local-wsdl-file',
        'wsdl_options' => [
            'location' => 'http://my-location.com',
            'cache_wsdl' => WSDL_CACHE_NONE,
        ],
    ]
);

$response = $soapClient->soapMethod([
    'methodParameter' => null,
]);



use Symfony\Component\Filesystem\Filesystem;
use TheIconic\NtlmSoap\Cache\FilesystemCache;
use TheIconic\NtlmSoap\Client\NtlmSoap;
use GuzzleHttp\Client;

$cacheRootDir = __DIR__.'/cache';
$defaultTtl = 3600; // cache the WSDL files for 1 hour

$client = new Client();
$cache = new FilesystemCache(new Filesystem(), $cacheRootDir, $defaultTtl);

$soapClient = new NtlmSoap(
    $client,
    $cache,
    [
        'username' => 'your-username',
        'password' => 'your-password',
        'wsdl' => 'http://myurl.com/remote/wsdl',
    ]
);

$response = $soapClient->soapMethod();