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.3.3RC1~192 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6597e855622f5466935ac71c0cffc233ddc842b5;p=php Fixed bug #50698 (SoapClient should handle wsdls with some incompatiable endpoints). (Justin Dearing) --- diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index 35c5e1af58..6bdb9e1294 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -832,7 +832,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; } } } @@ -1128,6 +1133,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 + + + + + + + +