PHP code example of cansozeri / php-soap-client

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

    

cansozeri / php-soap-client example snippets




use Canszr\SoapClient\SoapEngine;
use Canszr\SoapClient\SoapOptions;

use SoapEngine;

$options = SoapOptions::defaults($wsdl, [
            'soap_version' => SOAP_1_2,
        ])->disableWsdlCache();

$service = $this->fromOptions($options);



use Canszr\SoapClient\SoapOptions;

$options = SoapOptions::defaults($wsdl, ['soap_version' => SOAP_1_2])
    ->disableWsdlCache();

$typemap = $options->getTypeMap();
$typemap->add(new MyTypeConverter());



use Canszr\SoapClient\Handler\HttPlugHandle;
use Canszr\SoapClient\SoapEngine;
use Canszr\SoapClient\SoapOptions;
use Canszr\SoapClient\Middleware\BasicAuthMiddleware;
use Http\Adapter\Guzzle6\Client;


use SoapEngine;

$options = SoapOptions::defaults($wsdl, [
            'soap_version' => SOAP_1_2,
        ])->disableWsdlCache();

$handler = HttPlugHandle::createForClient(
    Client::createWithConfig(['headers' => ['User-Agent' => 'testing/1.0']])
);

$handler->addMiddleware(new BasicAuthMiddleware('user', 'password'));

$service = $this->fromOptionsWithHandler($options, $handler);



use Canszr\SoapClient\SoapEngine;
use Canszr\SoapClient\SoapOptions;

use SoapEngine;

$service = $this->fromOptions(SoapOptions::defaults($wsdl, []));