ap1234's avatar

Class "SoapClient" not found

Hey! I get this error when I am using Soap, (Class "SoapClient" not found) the extensions is already enabled in php.ini and in phpInfo it shows that soap is enabled. What could have gone wrong?

namespace App\Providers;

   use DOMDocument;
   use SoapClient;
       class DebugSoapClient extends SoapClient
                  
 {

    public $sendRequest = true;
    public $printRequest = false;
    public $formatXML = false;

    public function __doRequest($request, $location, $action, $version, $one_way = 0)
    {
        if ($this->printRequest) {
            if (!$this->formatXML) {
                $out = $request;
            } else {
                $doc = new DOMDocument();
                $doc->preserveWhiteSpace = false;
                $doc->loadxml($request);
                $doc->formatOutput = true;
                $out = $doc->savexml();
            }
            echo $out;
        }

        if ($this->sendRequest) {
            return parent::__doRequest($request, $location, $action, $version, $one_way);
        } else {
            return '';
        }
    }
    }
0 likes
2 replies
dealense's avatar

var_dump(extension_loaded('soap'));

also maybe you need to add in composer json "require": { "ext-soap": "*" ...

Please or to participate in this conversation.