Link to home
Start Free TrialLog in
Avatar of kevbob650
kevbob650Flag 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!
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kevbob650

ASKER

Thanks so much!  That was it, and I learned something new!
You are most welcome.