From: Dmitry Stogov Date: Wed, 5 May 2010 07:43:45 +0000 (+0000) Subject: Fixed bug #50698 (SoapClient should handle wsdls with some incompatiable endpoints... X-Git-Tag: php-5.2.14RC1~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=67cfe5fca171ee8cf89a3c4eb397902454a5130e;p=php Fixed bug #50698 (SoapClient should handle wsdls with some incompatiable endpoints). (Justin Dearing) --- diff --git a/NEWS b/NEWS index 221532c884..a16e3f5772 100644 --- a/NEWS +++ b/NEWS @@ -61,6 +61,8 @@ PHP NEWS - Fixed bug #51062 (DBA DB4 uses mismatched headers and libraries). (Chris Jones) - Fixed bug #51023 (filter doesn't detect int overflows with GCC 4.4). (Raphael Geissert) +- Fixed bug #50698 (SoapClient should handle wsdls with some incompatiable + endpoints). (Justin Dearing) - Fixed bug #50383 (Exceptions thrown in __call() / __callStatic() do not include file and line in trace). (Felipe) - Fixed bug #49723 (LimitIterator with empty SeekableIterator). (Etienne) diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index 655c9b4b5c..081187f6e8 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -831,7 +831,12 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC) if (strncmp((char*)tmp->children->content, WSDL_HTTP_TRANSPORT, sizeof(WSDL_HTTP_TRANSPORT)) == 0) { soapBinding->transport = SOAP_TRANSPORT_HTTP; } else { - soap_error1(E_ERROR, "Parsing WSDL: PHP-SOAP doesn't support transport '%s'", tmp->children->content); + /* try the next binding */ + efree(soapBinding); + efree(tmpbinding->location); + efree(tmpbinding); + trav = trav->next; + continue; } } } @@ -1127,6 +1132,10 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri TSRMLS_DC) soap_error0(E_ERROR, "Parsing WSDL: Couldn't bind to service"); } + if (ctx.sdl->bindings == NULL || ctx.sdl->bindings->nNumOfElements == 0) { + soap_error0(E_ERROR, "Parsing WSDL: Could not find any usable binding services in WSDL."); + } + zend_hash_destroy(&ctx.messages); zend_hash_destroy(&ctx.bindings); zend_hash_destroy(&ctx.portTypes); diff --git a/ext/soap/tests/bugs/bug50698_1.phpt b/ext/soap/tests/bugs/bug50698_1.phpt new file mode 100644 index 0000000000..c5d634a977 --- /dev/null +++ b/ext/soap/tests/bugs/bug50698_1.phpt @@ -0,0 +1,11 @@ +--TEST-- +Request #50698_1 (SoapClient should handle wsdls with some incompatiable endpoints) +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- + +--EXPECT-- +ok diff --git a/ext/soap/tests/bugs/bug50698_1.wsdl b/ext/soap/tests/bugs/bug50698_1.wsdl new file mode 100644 index 0000000000..9c6a9ad142 --- /dev/null +++ b/ext/soap/tests/bugs/bug50698_1.wsdl @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EncryptAndSign + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + diff --git a/ext/soap/tests/bugs/bug50698_2.phpt b/ext/soap/tests/bugs/bug50698_2.phpt new file mode 100644 index 0000000000..86ddf4806a --- /dev/null +++ b/ext/soap/tests/bugs/bug50698_2.phpt @@ -0,0 +1,20 @@ +--TEST-- +Request #50698_2 (SoapClient should handle wsdls with some incompatiable endpoints -- EDGECASE: Large mix of compatiable and incompatiable endpoints.) +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- +faultcode == 'WSDL' && $e->faultstring == 'SOAP-ERROR: Parsing WSDL: Could not find any usable binding services in WSDL.') { + echo "ok\n"; + } else { + echo "Call: \"new SoapClient(dirname(__FILE__).'/bug50698_2.wsdl');\" threw a SoapFault with an incorrect faultcode or faultmessage."; + print_r($e); + } +} +?> +--EXPECT-- +ok diff --git a/ext/soap/tests/bugs/bug50698_2.wsdl b/ext/soap/tests/bugs/bug50698_2.wsdl new file mode 100644 index 0000000000..e4dab6ce0f --- /dev/null +++ b/ext/soap/tests/bugs/bug50698_2.wsdl @@ -0,0 +1,422 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EncryptAndSign + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + http://localhost:8731/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + http://localhost:8731/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + http://localhost:8731/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + http://localhost:8731/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + http://localhost:8731/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + http://localhost:8731/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + http://localhost:8731/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + http://localhost:8731/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + http://localhost:8731/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + http://localhost:8731/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + diff --git a/ext/soap/tests/bugs/bug50698_3.phpt b/ext/soap/tests/bugs/bug50698_3.phpt new file mode 100644 index 0000000000..16a24dbe55 --- /dev/null +++ b/ext/soap/tests/bugs/bug50698_3.phpt @@ -0,0 +1,20 @@ +--TEST-- +Request #50698_3 (SoapClient should handle wsdls with some incompatiable endpoints -- EDGECASE: Large set of endpoints all incompatiable.) +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- +faultcode == 'WSDL' && $e->faultstring == 'SOAP-ERROR: Parsing WSDL: Could not find any usable binding services in WSDL.') { + echo "ok\n"; + } else { + echo "Call: \"new SoapClient(dirname(__FILE__).'/bug50698_3.wsdl');\" threw a SoapFault with an incorrect faultcode or faultmessage."; + print_r($e); + } +} +?> +--EXPECT-- +ok diff --git a/ext/soap/tests/bugs/bug50698_3.wsdl b/ext/soap/tests/bugs/bug50698_3.wsdl new file mode 100644 index 0000000000..bed21dfa4a --- /dev/null +++ b/ext/soap/tests/bugs/bug50698_3.wsdl @@ -0,0 +1,312 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EncryptAndSign + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + diff --git a/ext/soap/tests/bugs/bug50698_4.phpt b/ext/soap/tests/bugs/bug50698_4.phpt new file mode 100644 index 0000000000..ca444d7774 --- /dev/null +++ b/ext/soap/tests/bugs/bug50698_4.phpt @@ -0,0 +1,11 @@ +--TEST-- +Request #50698_4 (SoapClient should handle wsdls with some incompatiable endpoints) +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- + +--EXPECT-- +ok diff --git a/ext/soap/tests/bugs/bug50698_4.wsdl b/ext/soap/tests/bugs/bug50698_4.wsdl new file mode 100644 index 0000000000..dc9c3297e4 --- /dev/null +++ b/ext/soap/tests/bugs/bug50698_4.wsdl @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EncryptAndSign + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + net.tcp://localhost:8732/EchoService/ + + MAYA-DELL\Justin Dearing + + + + + + + +