From f779b01bca00489fbeadd795eae287dcb3821af7 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 5 Oct 2004 15:58:28 +0000 Subject: [PATCH] Fixed bug #30175 (SOAP results aren't parsed correctly) --- NEWS | 1 + ext/soap/php_packet_soap.c | 3 + ext/soap/tests/bugs/bug30175.phpt | 47 +++++++++++ ext/soap/tests/bugs/bug30175.wsdl | 126 ++++++++++++++++++++++++++++++ 4 files changed, 177 insertions(+) create mode 100644 ext/soap/tests/bugs/bug30175.phpt create mode 100644 ext/soap/tests/bugs/bug30175.wsdl diff --git a/NEWS b/NEWS index 54a24cdde8..d88f41fb01 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ PHP NEWS - Fixed bug #30276 (Possible crash in ctype_digit on large numbers). (Ilia) - Fixed bug #30224 (Sybase date strings are sometimes not null terminated). (Ilia) +- Fixed bug #30175 (SOAP results aren't parsed correctly). (Dmitry) - Fixed bug #30147 (OO sqlite_fetch_object did not reset error handler). (Wez) - Fixed bug #30133 (get_current_user() crashes on Windows). (Edin) - Fixed bug #30057 (did not detect IPV6 on FreeBSD 4.1). (Wez) 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