I want to use php's built in SoapClient class in laravel 5
I tried using it directly is shows error saying
Class 'App\Http\Controllers\SoapClient' not found.
I tried adding SoapClient
in aliases array in config/app.php
like this
'SoapClient' => SoapClient::class
Still not working
what should I do?
Thanks in Advance...
Soap - A Laravel SOAP client that provides a clean interface for handling requests and responses. Packages. March 29th, 2021.
Description ¶ This is a low level API function that is used to make a SOAP call. Usually, in WSDL mode, SOAP functions can be called as methods of the SoapClient object. This method is useful in non-WSDL mode when soapaction is unknown, uri differs from the default or when sending and/or receiving SOAP Headers.
SOAP is a communications XML-based protocol that lets applications exchange information through the internet. SOAP is platform independent and language independent. SOAP uses XML to specify a request and reply structure.
The class needs to be imported, so either do that at the top:
use SoapClient;
or reference it directly later:
$client = new \SoapClient($wsdl, $options);
I faced with same problem.
I activated Soap extension after I use php artisan serve
command and although I restarted my apache server I received same error..
After too many tries I stop artisan and restart it again and that was the solution for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With