Avatar of kevbob650
kevbob650
Flag for United States of America asked on

PHP WDSL Error on new server

I'm loading existing PHP code onto a new server and getting a fatal error with a soap wsdl:  

$this->client = new SoapClient(
      "https://servername.jws?WSDL",
      array("classmap" => $this->classmap,
      "location" => "https://servername.jws",
      "trace" => true,
      "exceptions" => true
      )
);

PHP Fatal error:  SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://servername.jws?WSDL' failed to load external entity 'https://servername.jws?WSDL'

If I test the wsdl in a test page:
$wsdl = "https://servername.jws?WSDL";
echo file_get_contents($wsdl);

I get an ssl error:
Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

A co-worker suggested this:
$arrContextOptions=array
(
    "ssl"=>array
                (
        "verify_peer"=>false,
        "verify_peer_name"=>false,
    ),
);

This works for the test scenario, but I have no idea how to incorporate it into the soap client???
Or is there another avenue to resolve the issue???
Any help would be appreciated!
PHPApache Web ServerSOAP Protocol

Avatar of undefined
Last Comment
Julian Hansen

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Julian Hansen

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
kevbob650

ASKER
Thanks so much!  That was it, and I learned something new!
Julian Hansen

You are most welcome.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck