From b5ae77e33db745ed5050f1d0ba24d25ccc6c8997 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 18 Jun 2008 07:24:14 +0000 Subject: [PATCH] Fixed SOAP binding selection --- ext/soap/php_sdl.c | 4 +- ext/soap/tests/bugs/bug29109.phpt | 6 +- ext/soap/tests/bugs/multiport.phpt | 16 ++++++ ext/soap/tests/bugs/multiport.wsdl | 88 ++++++++++++++++++++++++++++++ 4 files changed, 107 insertions(+), 7 deletions(-) create mode 100644 ext/soap/tests/bugs/multiport.phpt create mode 100644 ext/soap/tests/bugs/multiport.wsdl diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index dc1d667bd0..eea25c64e1 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -721,12 +721,12 @@ static sdlPtr load_wsdl(char *struri TSRMLS_DC) } trav2 = trav2->next; } - if (!address) { + if (!address || tmpbinding->bindingType == BINDING_HTTP) { if (has_soap_port || trav->next || i < n-1) { efree(tmpbinding); trav = trav->next; continue; - } else { + } else if (!address) { soap_error0(E_ERROR, "Parsing WSDL: No address associated with "); } } diff --git a/ext/soap/tests/bugs/bug29109.phpt b/ext/soap/tests/bugs/bug29109.phpt index b3447bd07d..7a0cbb366a 100644 --- a/ext/soap/tests/bugs/bug29109.phpt +++ b/ext/soap/tests/bugs/bug29109.phpt @@ -10,11 +10,7 @@ $client = new SoapClient(dirname(__FILE__)."/bug29109.wsdl"); var_dump($client->__getFunctions()); ?> --EXPECT-- -array(3) { +array(1) { [0]=> unicode(53) "HelloWorldResponse HelloWorld(HelloWorld $parameters)" - [1]=> - unicode(19) "string HelloWorld()" - [2]=> - unicode(19) "string HelloWorld()" } diff --git a/ext/soap/tests/bugs/multiport.phpt b/ext/soap/tests/bugs/multiport.phpt new file mode 100644 index 0000000000..0b5e944514 --- /dev/null +++ b/ext/soap/tests/bugs/multiport.phpt @@ -0,0 +1,16 @@ +--TEST-- +Proper binding selection +--SKIPIF-- + +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- + true, 'exceptions' => false)); +$response = $client->GetSessionId(array('userId'=>'user', 'password'=>'password')); +echo $client->__getLastRequest(); +?> +--EXPECT-- + +userpassword diff --git a/ext/soap/tests/bugs/multiport.wsdl b/ext/soap/tests/bugs/multiport.wsdl new file mode 100644 index 0000000000..604e963d81 --- /dev/null +++ b/ext/soap/tests/bugs/multiport.wsdl @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.50.1