How to debug Soap in PHP?

I am trying to do a SOAP request with PHP to a server, but all I’m getting is ‘Could not connect to host” when running

$this->client->__soapCall("aMethod()", [$request_param_array]));

I think the WSDL is fine, since I can reach it in my browser and when running


I do receive a list of available functions (as specified in this wsdl).

I do need a certificate to do SOAP calls to that server, so maybe that’s the problem? But I don’t know how I can debug what causes this “Could not connect to host” error.

Any ideas what can cause this error to occur or how I can find the problem?

My code so far:

public function __construct($url, $wsdl = null)
    $this->wsdl = $wsdl != null ? $wsdl : $url . '?wsdl';

    $this->client = new SoapClient($this->wsdl, array(
        "trace" => "1",
        "local_cert" => realpath(__DIR__ . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "..") . "cert.pfx",
        "passphrase" => "admin",
    Log::info(sprintf("New SoapClient created with WSDL: '%s'", $this->wsdl));

Source: stackoverflow-php