php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31050 SOAP class will not parse WSDL file located on a secure HTTPS connection
Submitted: 2004-12-10 05:22 UTC Modified: 2005-02-01 01:00 UTC
Votes:78
Avg. Score:4.7 ± 0.7
Reproduced:67 of 68 (98.5%)
Same Version:20 (29.9%)
Same OS:19 (28.4%)
From: dylanwoster at mac dot com Assigned: dmitry (profile)
Status: No Feedback Package: SOAP related
PHP Version: 5.0.2 OS: Mac OS X 10.3.6
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dylanwoster at mac dot com
New email:
PHP Version: OS:

 

 [2004-12-10 05:22 UTC] dylanwoster at mac dot com
Description:
------------
The built in SOAP class for PHP5 will not parse a WSDL 
file located on a secure HTTPS connection. The same WSDL 
works fine on an identical build on a Linux machine and 
any HTTP connections work fine.

Registered Streams: php, file, ftp, gopher, telnet, 
dict, ldap, http, https, ftps, compress.zlib

'./configure' '--with-mysql=/Library/MySQL' '--with-
apxs2=/Library/Apache2/bin/apxs' '--prefix=/Library/
PHP5' '--with-mysqli=/Library/MySQL/bin/mysql_config' 
'--with-libxml-dir=/usr/include/libxml2' '--with-curl=/
usr/local' '--with-curlwrappers' '--with-mcrypt=/usr/
local' '--with-java=/usr/bin/java' '--with-openssl' '--
with-zlib' '--with-gd' '--with-jpeg-dir=/usr/local' '--
with-png-dir=/usr/local' '--enable-xslt' '--with-xslt-
sablot' '--enable-soap' '--enable-sockets' '--enable-
ftp'

OpenSSL is version 0.9.7e

Reproduce code:
---------------
$client = new SoapClient( "https://arcweb.esri.com/services/v2/Authentication.wsdl" );
echo( $client->getVersion( ) );

Expected result:
----------------
On the Linux machine I get the version of the ESRI web 
services

Actual result:
--------------
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-
ERROR: Parsing WSDL: Couldn't load from 'https://
arcweb.esri.com/services/v2/Authentication.wsdl' in /
Users/dylanoster/Sites/www.maionline.com/site1/html/
soap.php:2 Stack trace: #0 {main}  thrown in /Users/
dylanoster/Sites/www.maionline.com/site1/html/soap.php 
on line 2

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-20 08:46 UTC] dmitry@php.net
I see no problems with latest CVS version on Linux, but I cannot test this on MacOS X.
 [2005-02-01 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-01-09 07:52 UTC] samirshah_082005 at yahoo dot com
I am getting the same error when creating soap client of a web service with https. Did anyone find any solution?
 [2006-05-31 10:13 UTC] ykin at vertriebsunion dot de
I have the same problem here. It's all served by an actual xampp installation on win2k servers.
The constructor is able to retrive the document per http and local file acess.
The https case procuses after a timeout minute following warning and not shown followup errors:

Warning: SoapClient::__construct(https://www.js.vertriebsunion.de/VuJournalService/Authentifizierung.asmx?WSDL) [function.--construct]: failed to open stream
 [2007-02-24 22:57 UTC] youngad6 at gmail dot com
Still a problem for PHP 5.2.1 running on OS X 10.4.8

./configure  --prefix=/apache2/php --enable-soap --enable-memory-limit --with-mysql=/usr/local/mysql --with-mysqli --with-zlib --with-xml --with-ldap=/usr --enable-cli --with-zlib-dir=/usr --enable-exif --enable-ftp --enable-mbstring --enable-mbregex --enable-dbx --enable-sockets --with-iodbc=/usr --with-curl=/usr --with-apxs2=/apache2/bin/apxs
 [2007-04-19 02:47 UTC] kkallio at micorp dot com dot ve
Same problem on a modified Debian Sarge, PHP 5.2.0

'./configure' '--prefix=/usr' '--libexecdir=/usr/lib/php5.2.0/libexec' '--datadir=/usr/share/php5.2.0' '--sysconfdir=/etc/php5.2.0' '--includedir=/usr/include/php5.2.0' '--with-config-file-path=/etc/php5.2.0' '--with-apxs2=/usr/bin/apxs2' '--with-odbtp=/usr' '--with-kerberos' '--with-pcre-regex' '--enable-versioning' '--enable-sigchild' '--enable-magic-quotes' '--enable-mbstring' '--enable-session' '--enable-mbregex' '--enable-msession' '--with-openssl' '--enable-pdo' '--with-pdo-mysql' '--with-pdo-oci=instantclient,/usr/lib/oracle/10.2.0.2,10.1' '--with-pdo-odbc=unixODBC,/usr' '--with-pdo-pgsql' '--with-pdo-firebird' '--without-pdo-sqlite' '--enable-bcmath' '--with-bz2' '--enable-calendar' '--enable-ctype' '--with-curl' '--with-curlwrappers' '--enable-dba' '--with-gdbm' '--with-db4' '--with-cdb' '--with-inifile' '--with-flatfile' '--enable-dbase' '--enable-exif' '--enable-filepro' '--enable-ftp' '--with-gd' '--with-jpeg-dir' '--with-png-dir' '--with-zlib-dir' '--enable-gd-native-ttf' '--enable-gd-jis-conv' '--with-ttf' '--with-freetype-dir' '--with-gettext' '--with-gmp' '--with-ldap' '--with-ldap-sasl' '--with-mcrypt' '--with-mhash' '--with-mime-magic' '--with-mssql' '--with-mysql=/usr' '--with-mysqli=/usr/bin/mysql_config' '--with-oci8=instantclient,/usr/lib/oracle/10.2.0.2' '--with-oracle' '--with-unixODBC=/usr' '--with-odbc=/usr' '--with-pgsql' '--enable-shmop' '--enable-soap' '--enable-sockets' '--with-sqlite' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--with-tidy' '--enable-wddx' '--enable-xml' '--disable-xmlreader' '--with-xmlrpc' '--disable-xmlwriter' '--with-xsl' '--with-pear=/usr/share/php5.1.4/pear' '--enable-shared' '--with-zend-vm' '--with-snmp' '--with-readline' '--with-libedit' '--with-pspell' '--enable-pcntl' '--enable-maintainer-zts' '--with-tsrm-pthreads'
 [2007-05-05 08:25 UTC] john at soundreal dot co dot uk
I'm getting the same problem Mac OS X 10.4.9 PHP 5.2.1

$SoapClient=new SoapClient('https://api.foo.com/fooService.wsdl' ,array("connection_timeout"=>5));


'./configure' '--prefix=/Library/PHP5' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc' '--with-zlib' '--with-xml' '--with-zlib-dir=/usr' '--with-openssl' '--enable-exif' '--enable-ftp' '--enable-mbstring' '--enable-mbregex' '--enable-sockets' '--with-mysql=/usr/local/mysql' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-apxs' '--with-libjpeg' '--with-libtiff=/sw' '--with-libpng' '--with-gd' '--with-gettext' '--enable-soap' '--with-curl'
 [2008-01-03 13:08 UTC] php at eflow dot dk
I have the problem too, on Gentoo Linux.

Apache 2.2.6
PHP 5.2.5
OpenSSL 0.9.8g

Configuration:
'./configure' '--prefix=/usr/lib/php5' '--host=i686-pc-linux-gnu' '--mandir=/usr/lib/php5/man' '--infodir=/usr/lib/php5/info' '--sysconfdir=/etc' '--cache-file=./config.cache' '--disable-cli' '--with-apxs2=/usr/sbin/apxs2' '--with-config-file-path=/etc/php/apache2-php5' '--with-config-file-scan-dir=/etc/php/apache2-php5/ext-active' '--without-pear' '--disable-bcmath' '--with-bz2' '--disable-calendar' '--with-curl' '--with-curlwrappers' '--disable-dbase' '--disable-exif' '--without-fbsql' '--without-fdftk' '--disable-filter' '--disable-ftp' '--with-gettext' '--without-gmp' '--disable-hash' '--disable-json' '--without-kerberos' '--enable-mbstring' '--with-mcrypt' '--without-mhash' '--without-msql' '--without-mssql' '--with-ncurses' '--with-openssl' '--with-openssl-dir=/usr' '--disable-pcntl' '--disable-pdo' '--without-pgsql' '--disable-posix' '--with-pspell' '--without-recode' '--disable-shmop' '--without-snmp' '--enable-soap' '--disable-sockets' '--without-sybase' '--without-sybase-ct' '--disable-sysvmsg' '--disable-sysvsem' '--disable-sysvshm' '--without-tidy' '--disable-wddx' '--with-xmlrpc' '--with-xsl' '--enable-zip' '--with-zlib' '--disable-debug' '--enable-dba' '--without-cdb' '--with-db4' '--without-flatfile' '--with-gdbm' '--without-inifile' '--without-qdbm' '--with-freetype-dir=/usr' '--with-t1lib=/usr' '--disable-gd-jis-conv' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--without-xpm-dir' '--with-gd' '--with-ldap' '--with-ldap-sasl' '--with-mysql=/usr' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-mysqli=/usr/bin/mysql_config' '--with-readline' '--without-libedit' '--without-mm' '--with-sqlite=/usr' '--enable-sqlite-utf8'
 [2008-01-23 04:31 UTC] marcus dot uy at virtualthinking dot com
Hi,

Having similar problem on Windows XP Pro:

Apache 2.2.8
PHP 5.2.5
OpenSSL 0.9.8g

In my case the connectiion works once, then fails on the next connection attempt.  I then have to restart apache because the soapserver becomes completely unresponsive.
 [2008-04-02 01:03 UTC] jfarhat at kirkhamsystems dot com
I am also having the same problem in PHP 5.2.5. the procedure code at the end of the message works for HTTP but fails with HTTPS with the message:
SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://arcweb.esri.com/services/v2/Authentication.wsdl' ....



Reproduce code:
---------------
$client = new SoapClient(
"https://arcweb.esri.com/services/v2/Authentication.wsdl" );
echo( $client->getVersion( ) );
 [2008-04-22 15:20 UTC] pejusdas at gmail dot com
I'm having the same problem with a linux box running php 5.2.5 and a win xp box running the same version. Has anybody found the solution for this problem yet? Thanks.


Pejus
 [2008-06-19 14:22 UTC] trippinbilly25 at gmail dot com
I have solved this problem on Windows XP by replacing the following .dll files in the System32 folder with their versions located in the php folder:

libeay.dll
ssleay32.dll

For some reason an error was logged in my Apache error log that said OpenSSL was not being loaded, replacing these files solved the problem for me.
 [2008-07-07 17:29 UTC] john at soundreal dot co dot uk
I've cracked this, problem was with my php configuration. Needed to 
recompile using

-with-openssl

now working fine on Mac os 10.4.11 with php 5.2.6
 [2009-03-05 12:13 UTC] ykohut at parallels dot com
I have the same bug on:
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.2 (Tikanga)
# uname -p
i686
# /hsphere/shared/php5/bin/php-cli --version
PHP 5.2.9 (cli) (built: Mar  5 2009 01:52:37)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
    with the ionCube PHP Loader v3.1.32, Copyright (c) 2002-2007, by ionCube Ltd., and
    with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
    with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies

The SOAP is loaded as external extension via corresponded .ini file:
#cat php.d/soap.ini
; Enable soap extension module
extension=soap.so

The extension is successfully loaded, which is reported php_info():
soap
Soap Client 	enabled
Soap Server 	enabled

Directive	Local Value	Master Value
soap.wsdl_cache	1	1
soap.wsdl_cache_dir	/tmp	/tmp
soap.wsdl_cache_enabled	1	1
soap.wsdl_cache_limit	5	5
soap.wsdl_cache_ttl	86400	86400

and with # php-cli -i:
# /hsphere/shared/php5/bin/php-cli -i|grep soap
Configure Command =>  './configure'  '--localstatedir=/var/hsphere/php' '--with-bz2=/hsphere/shared' '--enable-ctype' '--enable-dba' '--enable-ftp' '--with-gettext=/hsphere/shared' '--enable-mbstring=all' '--with-gd' '--with-mhash=/hsphere/shared' '--with-mcrypt=/hsphere/shared' '--with-openssl=/usr' '--enable-overload' '--enable-posix' '--enable-session' '--enable-sockets' '--enable-standard' '--enable-tokenizer' '--with-xml=/hsphere/shared' '--with-xsl=/hsphere/shared' '--with-zip=/hsphere/shared' '--with-zlib=/hsphere/shared' '--with-zlib-dir=/hsphere/shared' '--with-freetype-dir=/hsphere/shared' '--with-png-dir=/hsphere/shared' '--with-jpeg-dir=/hsphere/shared' '--with-expat-dir=/hsphere/shared' '--with-iconv-dir=/hsphere/shared' '--with-libxml-dir=/hsphere/shared' '--enable-gd-native-ttf' '--with-ttf' '--enable-mbstr-enc-trans' '--with-expat-dir=/hsphere/shared' '--with-xslt-sablot=/hsphere/shared' '--with-gnu-ld' '--with-curl=shared,/hsphere/shared' '--with-curlwrappers' '--with-dom=shared,/hsphere/shared' '--with-dom-xslt=/hsphere/shared' '--with-dom-exslt=/hsphere/shared' '--with-dom=shared,/hsphere/shared' '--with-fileinfo=shared,/hsphere/shared' '--with-gmp=shared,/hsphere/shared' '--with-iconv=shared,/hsphere/shared' '--with-imap=shared,/hsphere/shared' '--with-imap-ssl=shared,/usr' '--with-mcal=shared,/hsphere/shared' '--with-mysql=shared,/usr' '--with-mysqli=shared' '--with-pgsql=shared,/usr' '--with-sqlite=shared' '--enable-sqlite-utf8' '--with-unixODBC=shared,/hsphere/shared' '--with-xmlrpc=shared' '--enable-htscanner' '--enable-track-vars' '--enable-trans-sid' '--enable-memory-limit' '--enable-force-cgi-redirect' '--enable-fastcgi' '--with-config-file-path=/hsphere/local/config/httpd/php5' '--with-config-file-scan-dir=/hsphere/local/config/httpd/php5/php.d' '--enable-magic-quotes' '--with-pear=/hsphere/shared/apache/libexec/php5ext/php' '--with-mime-magic=/hsphere/local/config/httpd/magic' '--with-inifile' '--with-flatfile' '--enable-pdo=shared' '--with-pdo-sqlite=shared' '--with-pdo-mysql=shared' '--with-pdo-pgsql=shared' '--enable-soap=shared' '--prefix=/hsphere/shared/php5' '--with-apxs=/hsphere/shared/apache/bin/apxs' '--enable-cli'
/hsphere/local/config/httpd/php5/php.d/soap.ini,
soap
soap.wsdl_cache => 1 => 1
soap.wsdl_cache_dir => /tmp => /tmp
soap.wsdl_cache_enabled => 1 => 1
soap.wsdl_cache_limit => 5 => 5
soap.wsdl_cache_ttl => 86400 => 86400


The is no matter in which mode PHP is running. The problem take place as well on Apache handler (libphp mode) and CGI/FastCGI modes.


The error looks like in:
 - Apache error_log :
[Wed Mar 11 08:23:34 2009] [error] [client 192.168.128.234] failed to load external entity "https://soap.amazon.com/schemas3/AmazonWebServices.wsdl"

 - php_error.log :
[11-Mar-2009 08:23:34] PHP Fatal error:  SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://soap.amazon.com/schemas3/AmazonWebServices.wsdl' : failed to load external entity "https://soap.amazon.com/schemas3/AmazonWebServices.wsdl"
 in /hsphere/local/home/web-2/web2.r527/soap.php on line 2

The test script used:
# cat soap.php
<?php
$client = new SoapClient("https://soap.amazon.com/schemas3/AmazonWebServices.wsdl", array('exceptions' => 0));
$result = $client->__getFunctions();
if (is_soap_fault($result)) {
    trigger_error("SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faultstring})", E_USER_ERROR);
}
else {
    var_dump($result);
}
?>



We investigated the problem very close and discovered that the reason is with libxml libraries statically compiled into PHP.
Details: PHP is compiled with the following XML related options:
--with-xml=/hsphere/shared
--with-libxml-dir=/hsphere/shared
--with-xmlrpc=shared

If libxml2 static library is available in the {prefix} directory (libxml2.a), PHP includes libxml2 library into itself at buildtime.
In that case, soap FAILS to work with https.

If libxml2 shared library is available in the {prefix} directory (libxml2.so), PHP doesn't includes libxml2 library into itself at buildtime, but seach the library at runtime.
In that case, soap works with https fine.

Please let me know if more details required.
Also please advise the issue solution.
 [2010-09-14 12:24 UTC] zhb1208 at hotmail dot com
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://192.168.0.14:8080/rpc/soap/jirasoapservice-v2?wsdl' : failed to load external entity "http://192.168.0.14:8080/rpc/soap/jirasoapservice-v2?wsdl"
 [2010-09-16 10:32 UTC] zhb1208 at hotmail dot com
resolveļ¼š
I found the problem was related to linux configuration. 

The firewall is enabled on my server: policy type is targeted, enforcing current is checked and HTTPD scripts to connect to the network were not allowed.

linux:
$setsebool -P httpd_can_network_connect on 

I checked it and it is working now.
 [2014-06-20 12:34 UTC] 66ton99 at gmail dot com
It is present in PHP v5.4.29 on mac but it is not a bug. It solves by installing openssl extension;
But would be nice to know why lib can't load external url! Is it connection problem in some cases or protocol https does not support as in my case.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC