Issues

ZF-11273: Zend_Soap_Client via HTTPS does not work, cannot load WSDL

Description

Reference to Zend support case 00035125, "Zend_Soap_Client via HTTPS" [ ref:00D2FyX.5007GD4q4:ref ] Supervised by Mr Shlomo Vanunu, Zend Global Support

There is no problem to access webservices via http, but it seems to be impossible via httpS. We always get the error message

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://[soapurl]?wsdl' : failed to load external entity "https://[soapurl]?wsdl" in /usr/local/zendsvr/share/ZendFramework/library/Zend/Soap/Client/Common.php:51 Stack trace: #0 /usr/local/zendsvr/share/ZendFramework/library/Zend/Soap/Client/Common.php(51): SoapClient->SoapClient('https://integra...', Array) #1 /usr/local/zendsvr/share/ZendFramework/library/Zend/Soap/Client.php(1024): Zend_Soap_Client_Common->__construct(Array, 'https://integra...', Array)

2

/usr/local/zendsvr/share/ZendFramework/library/Zend/Soap/Client.php(1180): Zend_Soap_Client->_initSoapClientObject() #3 /usr/local/zendsvr/share/ZendFramework/library/Zend/Soap/Client.php(1104): Zend_Soap_Client->getSoapClient() #4 /www/zendsvr/htdocs/test/g210_test_zendsoap.php(204): Zend_Soap_Client->__call('AnfragePerson', Array) #5 /www/ze in /usr/local/zendsvr/share/ZendFramework/library/Zend/Soap/Client/Common.php on line 51

The weird thing is that it works perfectly with the external package "nuSOAP"!

Unfortunately, nuSOAP seems to be quite slow, so we wanted to compare it with the standard PHP soapClient and Zend_Soap_Client.

Finally, we found this comment:

"BTW, PHP 5.3 version of Zend Server 5.0.2 on iSeries does not support Zend_Soap_Client to access web service over the SSL."

http://yiyujia.blogspot.com/2010/10/…

Is this true? What about PHP 5.3.3 and Zend Server 5.0.4?

Comments

At my workplace our development and production platforms run PHP v5.3.3 and Zend Framework v1.11.5 on Apache v2.2.16 (not Zend Server) and we've had no issues using Zend_Soap_Client to access SOAP web services over HTTPS.

Could you provide the code sample from your application which triggers this error?

Hello,

here is the code sample:

<?php error_reporting(E_ALL & ~E_WARNING); ini_set('display_errors', TRUE); ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache... include('array2xml.php'); $wsdl = 'https://integration-sync.his-connect.de/services/…'; try { $SoapClient = new Zend_Soap_Client($wsdl, array('encoding' => 'UTF-8', 'soap_version' => SOAP_1_1)); // Standard PHP would look like // $SoapClient = new soapclient($wsdl); // nuSoap would like // $SoapClient = new nusoap_client($wsdl, 'wsdl'); $SoapClient->soap_defencoding = 'UTF-8'; } catch (Exception $e) { echo 'Exception ',$e->getCode(),' caught: ', $e->getMessage(), "\n"; } $element_name = 'Anfrage_Person_A_Anfrage'; $operation_name = 'AnfragePerson'; $header = ""; $footer = "".$element_name.">"; // $param = array(...) $xml = new arr2xml($param); $xmlstring=$xml->get_xml(); $result = $SoapClient->AnfragePerson(utf8_encode(str_replace('&', '&', $header.$xmlstring.$footer))); // Standard PHP does not work either // $result = $SoapClient->__call($operation_name, utf8_encode(str_replace('&', '&', $header.$xmlstring.$footer)), $soapoptions); // nuSoap will work: // $result = $SoapClient->call($operation_name, utf8_encode(str_replace('&', '&', $header.$xmlstring.$footer)), '', '', false, true, 'rpc'); ?>

Any news on this issue?

I'm fairly certain this has nothing to do with {{Zend_Soap}}. The stacktrace shows that the error originates in {{Zend_Soap_Client_Common}}, but since it merely extends PHP's built-in {{SoapClient}} class, there isn't much that can be done for you from the Zend Framework side.

That said, my totally awesome googling skills have revealed a number of posts on the Zend Forums in which users of Zend Server complain about the same issue (ie: works with nuSOAP but not with SoapClient/Zend_Soap). None of them appear to be resolved:

http://forums.zend.com/viewtopic.php?f=8&t=399 http://forums.zend.com/viewtopic.php?f=77&t=9451 http://forums.zend.com/viewtopic.php?f=77&t=7458

That last one backs up what the OP mentioned at the end of their post: PHP 5.3 version of Zend Server 5.0.2 on iSeries does not support Zend_Soap_Client to access web service over SSL. Apparently it was supposed to be fixed in 5.0.3, but I don't use Zend Server and so can't comment on that.

My summation: This is an issue with Zend Server and not Zend Framework. Please contact Zend Support, or ask the Zend Server CE community for help.

Closing ticket. Not a Zend Framework issue.