Using PHPSoapClient to process self-built certificate https service using PHP SoapClient to process authenticated https webservice is completely correct. However, if you encounter some problems when you do not authenticate https but use a self-built certificate for https, the error "cocould not connect to host." is generally reported.
One solution is to try SoapClient to ignore https ssl authentication and directly skip the authentication process and paste the code directly.
$ Context = stream_context_create (array ('SSL '=> array ('verify _ peer' => false, 'Allow _ self_signe' => true ),)); $ options ['stream _ context'] = $ context; $ client = new SoapClient ($ url, $ options );
Verify_peer: Specifies whether to verify ssl. the default value is true.
Allow_self_signed: whether to allow https services with self-built certificates. the default value is false.
Post official documents: http://php.net/manual/en/context.ssl.php