skip to Main Content

Using Plesk 12.5 and PHP 7.0.2 I get the error:

SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://<IP ADDRESS>:9443/Configuration?wsdl' : failed to load external entity "https://<IP ADDRESS>:9443/Configuration?wsdl" in <PHP FILE>:51 Stack trace: #0 <PHP FILE>(51): SoapClient->SoapClient('https://<IP FILE>', Array) #1 

It works using PHP 5.3 from the OS, but and PHP from Plesk I get the above error.

PHP-SOAP, XML, is installed.

The code I am using is:

                try {
                    $configClient = new soapclient("https://{$node["host"]}:{$node["port"]}/Configuration?wsdl",
                            array('login'   => $node["user"],
                            'password'      => $node["pass"],
                            'trace'         => 1,
                            'cache_wsdl'    => WSDL_CACHE_NONE,
                            'features'      => SOAP_SINGLE_ELEMENT_ARRAYS
                            )
                    );

                    $configResponse = $configClient->enableALLProductFeatures();
            } catch (SoapFault $exception) {
                    echo "Problem..... : ";
                    echo $exception;
            }

2

Answers


  1. Chosen as BEST ANSWER

    Resolved by stream_context options. My code now looks like the following:

                    $context = stream_context_create(array(
                        'ssl' => array('verify_peer' => false, 'verify_peer_name'=>false, 'allow_self_signed' => true)
                    ));
    
                    try {
                    $configClient = new soapclient("https://{$node["host"]}:{$node["port"]}/Configuration?wsdl",
                            array('login'   => $node["user"],
                            'password'      => $node["pass"],
                            'trace'         => 1,
                            'cache_wsdl'    => WSDL_CACHE_NONE,
                            'features'      => SOAP_SINGLE_ELEMENT_ARRAYS,
                            'stream_context' => $context
                            )
                    );
    
                    $configResponse = $configClient->enableALLProductFeatures();
            } catch (SoapFault $exception) {
                    echo "Problem..... : ";
                    echo $exception;
            }
    

  2. Try debug your connection with curl:

    curl -v --user "<login>:<password>" --header "Content-Type: text/xml;charset=UTF-8" --header "SOAPAction:<action>" --data @<file_name> <url_of_the_soap_web_service>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search