Laravel 8 Soap Client Kullanımı

Laravel 8 Soap Client Kullanımı

Laravel 8 Soap Client Kullanımı

Soap için gayet güzel ve kullanımı kolay olan aşağıdaki kütüphaneyi projemize dahil ediyoruz.

composer require ricorocks-digital-agency/soap

 

Daha sonra Controller da kütüphanemizi gösteriyoruz.

use RicorocksDigitalAgency\Soap\Facades\Soap

 

Authentication işlemini aşağadaki gibi yapabilirsiniz

Soap::to('...')->withBasicAuth('username', 'password')->call('...');
Soap::to('...')->withDigestAuth('username', 'password')->call('...');

Parametreler

Soap::to('github.com/api')->call('merge', ['branch' => 'staging', 'credentials' => ['password' => '...']);

Global Headers

Soap::headers(soap_header('Auth', 'test.com'))->for('https://api.example.com');

Soap::headers(soap_header('Brand', 'test.com'))->for('https://api.example.com', 'Customers');

 

 

$header = Soap::header()
            ->name('Authentication')
            ->namespace('test.com')
            ->data([
                'user' => '...',
                'password' => '...'
            ])
            ->mustUnderstand()
            ->actor('foo.co.uk')

 

 

örnek:

$customers = Soap::to('url wsdl yazıyoruz')
    ->CheckEmployee(['ApiKey' => 'xx', 'UserIp' => 'x.x.x.x', 'code' => $request->kod]);

 

Laravel 8 Soap Client Kullanımı
Paylaş: