From fb6072e10dac347cdcdeae3827cbcd46bd0b642a Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 5 Oct 2004 16:00:40 +0000 Subject: [PATCH] Fixed bug #30175 (SOAP results aren't parsed correctly) --- ext/soap/php_packet_soap.c | 3 + ext/soap/tests/bugs/bug30175.phpt | 47 +++++++++++ ext/soap/tests/bugs/bug30175.wsdl | 126 ++++++++++++++++++++++++++++++ 3 files changed, 176 insertions(+) create mode 100644 ext/soap/tests/bugs/bug30175.phpt create mode 100644 ext/soap/tests/bugs/bug30175.wsdl diff --git a/ext/soap/php_packet_soap.c b/ext/soap/php_packet_soap.c index 2b781e868e..7b0465f1f2 100644 --- a/ext/soap/php_packet_soap.c +++ b/ext/soap/php_packet_soap.c @@ -271,6 +271,9 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction cur = get_node(resp, name); /* TODO: produce warning invalid ns */ } + if (!cur && fnb->style == SOAP_RPC) { + cur = resp; + } if (cur) { if (fnb->style == SOAP_DOCUMENT) { val = cur; diff --git a/ext/soap/tests/bugs/bug30175.phpt b/ext/soap/tests/bugs/bug30175.phpt new file mode 100644 index 0000000000..f5501ac9bd --- /dev/null +++ b/ext/soap/tests/bugs/bug30175.phpt @@ -0,0 +1,47 @@ +--TEST-- +Bug #30175 (SOAP results aren't parsed correctly) +--SKIPIF-- + +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- + + + + +blah blah some name field +This is a description. more blah blah blah +127.0.0.1 + + + +EOF; + } + +} + +$client = new LocalSoapClient(dirname(__FILE__)."/bug30175.wsdl"); +var_dump($client->qwebGetHostInfo()); +?> +--EXPECT-- +array(3) { + ["name"]=> + string(25) "blah blah some name field" + ["shortDescription"]=> + string(42) "This is a description. more blah blah blah" + ["ipAddress"]=> + string(9) "127.0.0.1" +} diff --git a/ext/soap/tests/bugs/bug30175.wsdl b/ext/soap/tests/bugs/bug30175.wsdl new file mode 100644 index 0000000000..f4cae2554e --- /dev/null +++ b/ext/soap/tests/bugs/bug30175.wsdl @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Service definition of function ns1__qwebSquare + + + + + Service definition of function ns1__qwebStrlen + + + + + Service definition of function ns1__qwebGetHostInfo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Demo Qweb SOAP interface + + + + + + -- 2.50.1