We help IT Professionals succeed at work.
Get Started

PHP WDSL Error on new server

1,472 Views
Last Modified: 2016-02-16
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!
Comment
Watch Question
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2017
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE