Ask a Question related to PHP Bugs, Design and Development.
-
sos at sokhapkin dot dyndns dot org #1
#39121 [NEW]: Incorrect return array handling in non-wsdl soap client.
From: sos at sokhapkin dot dyndns dot org
Operating system: Gentoo linux
PHP version: 5.1.6
PHP Bug Type: SOAP related
Bug description: Incorrect return array handling in non-wsdl soap client.
Description:
------------
Return soap type array needs special handling in non-wsdl mode. The return
array should have numeric indexes only because all elements of returned
array have the same name.
Here is the pacth to fix the problem:
--- php_packet_soap.c.orig 2006-01-01 07:50:13.000000000 -0500
+++ php_packet_soap.c 2006-10-10 17:50:50.000000000 -0400
@@ -338,9 +338,18 @@
if (val != NULL) {
if
(!node_is_equal_ex(val,"result",RPC_SOAP12_NAMESPA CE)) {
zval *tmp;
+ int isarray = 0;
+ if(xmlHasProp(val,
"type")) {
+ xmlChar *type;
+ type =
xmlGetProp(val, "type");
+ if(strstr(type,
":Array"))
+ isarray =
1;
+ xmlFree(type);
+ }
+
tmp = master_to_zval(NULL,
val);
- if (val->name) {
+ if (val->name && !isarray)
{
add_assoc_zval(return_value, (char*)val->name, tmp);
} else {
add_next_index_zval(return_value, tmp);
Reproduce code:
---------------
Here is an example of soap return xml:
<soapenc:Array soapenc:arrayType="xsd:anyType[4]"
xsi:type="soapenc:Array"><item xsi:type="xsd:long">17326080650</item><item
xsi:type="xsd:int">1</item><item xsi:type="xsd:float">1.99</item><item
xsi:type="xsd:int">0</item></soapenc:Array><soapenc:Array
soapenc:arrayType="xsd:anyType[4]" xsi:type="soapenc:Array"><item
xsi:type="xsd:long">17325882599</item><item
xsi:type="xsd:int">1</item><item xsi:type="xsd:float">1.99</item><item
xsi:type="xsd:int">0</item></soapenc:Array>
Expected result:
----------------
Array => (
[0] => Array => (
[0] => 17326080650
[1] => 1
[2] => 1.99
[3] => 0
)
[1] => Array => (
[0] => 17325882599
[1] => 1
[2] => 1.99
[3] => 0
)
)
Actual result:
--------------
Array => (
[Array] => Array => (
[0] => 17325882599
[1] => 1
[2] => 1.99
[3] => 0
)
)
--
Edit bug report at [url]http://bugs.php.net/?id=39121&edit=1[/url]
--
Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=39121&r=trysnapshot44[/url]
Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=39121&r=trysnapshot52[/url]
Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=39121&r=trysnapshot60[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=39121&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=39121&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=39121&r=needtrace[/url]
Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=39121&r=needscript[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=39121&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=39121&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=39121&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=39121&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=39121&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=39121&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=39121&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=39121&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=39121&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=39121&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=39121&r=float[/url]
No Zend Extensions: [url]http://bugs.php.net/fix.php?id=39121&r=nozend[/url]
MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=39121&r=mysqlcfg[/url]
sos at sokhapkin dot dyndns dot org Guest
-
#40210 [NEW]: SOAP client crash when parse WSDL file located on a SSL/TLS apache server
From: maboiteaspam at gmail dot com Operating system: Solaris 8 PHP version: 5.2.0 PHP Bug Type: SOAP related Bug... -
Writing a HTML/ASP SOAP client for a SOAP::Lite destination
How would I go about writing a SOAP client in either HTML or classic asp? The SOAP "listener" was written in Perl with SOAP::Lite in Unix and I am... -
Soap without WSDL
Hi, I am relatively new to SOAP and trying to connect to a web service of a partner company. So far I have failed in the attempts as I have no... -
Returning array Via soap toolkit to vb.net client
Hi, I have a suite of Com components , a number of the methods return a VARIANT which is of type array . The array is multi-dimensional. I have... -
SOAP Client creation in ASP.NET using MS SOAP Toolkit
how would I create a SOAP client in ASP.Net? The following code just works fine in VB: Dim lobjSOAP As New MSSOAPLib30.SoapClient30... -
tony2001@php.net #2
#39121 [Opn->Asn]: Incorrect return array handling in non-wsdl soap client.
ID: 39121
Updated by: [email]tony2001@php.net[/email]
Reported By: sos at sokhapkin dot dyndns dot org
-Status: Open
+Status: Assigned
Bug Type: SOAP related
Operating System: Gentoo linux
PHP Version: 5.1.6
-Assigned To:
+Assigned To: dmitry
New Comment:
Assigned to the maintainer.
Previous Comments:
------------------------------------------------------------------------
[2006-10-10 22:32:38] sos at sokhapkin dot dyndns dot org
Description:
------------
Return soap type array needs special handling in non-wsdl mode. The
return array should have numeric indexes only because all elements of
returned array have the same name.
Here is the pacth to fix the problem:
--- php_packet_soap.c.orig 2006-01-01 07:50:13.000000000 -0500
+++ php_packet_soap.c 2006-10-10 17:50:50.000000000 -0400
@@ -338,9 +338,18 @@
if (val != NULL) {
if
(!node_is_equal_ex(val,"result",RPC_SOAP12_NAMESPA CE)) {
zval *tmp;
+ int isarray = 0;
+ if(xmlHasProp(val,
"type")) {
+ xmlChar *type;
+ type =
xmlGetProp(val, "type");
+ if(strstr(type,
":Array"))
+ isarray
= 1;
+ xmlFree(type);
+ }
+
tmp =
master_to_zval(NULL, val);
- if (val->name) {
+ if (val->name &&
!isarray) {
add_assoc_zval(return_value, (char*)val->name, tmp);
} else {
add_next_index_zval(return_value, tmp);
Reproduce code:
---------------
Here is an example of soap return xml:
<soapenc:Array soapenc:arrayType="xsd:anyType[4]"
xsi:type="soapenc:Array"><item
xsi:type="xsd:long">17326080650</item><item
xsi:type="xsd:int">1</item><item xsi:type="xsd:float">1.99</item><item
xsi:type="xsd:int">0</item></soapenc:Array><soapenc:Array
soapenc:arrayType="xsd:anyType[4]" xsi:type="soapenc:Array"><item
xsi:type="xsd:long">17325882599</item><item
xsi:type="xsd:int">1</item><item xsi:type="xsd:float">1.99</item><item
xsi:type="xsd:int">0</item></soapenc:Array>
Expected result:
----------------
Array => (
[0] => Array => (
[0] => 17326080650
[1] => 1
[2] => 1.99
[3] => 0
)
[1] => Array => (
[0] => 17325882599
[1] => 1
[2] => 1.99
[3] => 0
)
)
Actual result:
--------------
Array => (
[Array] => Array => (
[0] => 17325882599
[1] => 1
[2] => 1.99
[3] => 0
)
)
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=39121&edit=1[/url]
tony2001@php.net Guest
-
dmitry@php.net #3
#39121 [Asn->Fbk]: Incorrect return array handling in non-wsdl soap client.
ID: 39121
Updated by: [email]dmitry@php.net[/email]
Reported By: sos at sokhapkin dot dyndns dot org
-Status: Assigned
+Status: Feedback
Bug Type: SOAP related
Operating System: Gentoo linux
PHP Version: 5.1.6
Assigned To: dmitry
New Comment:
I cannot analyze the report without full SOAP Envelope. I fixed one bug
related to this report, but I cannot be sure that it fixes your issue.
(Your pathch is completly wrong).
Previous Comments:
------------------------------------------------------------------------
[2006-10-10 22:42:36] [email]tony2001@php.net[/email]
Assigned to the maintainer.
------------------------------------------------------------------------
[2006-10-10 22:32:38] sos at sokhapkin dot dyndns dot org
Description:
------------
Return soap type array needs special handling in non-wsdl mode. The
return array should have numeric indexes only because all elements of
returned array have the same name.
Here is the pacth to fix the problem:
--- php_packet_soap.c.orig 2006-01-01 07:50:13.000000000 -0500
+++ php_packet_soap.c 2006-10-10 17:50:50.000000000 -0400
@@ -338,9 +338,18 @@
if (val != NULL) {
if
(!node_is_equal_ex(val,"result",RPC_SOAP12_NAMESPA CE)) {
zval *tmp;
+ int isarray = 0;
+ if(xmlHasProp(val,
"type")) {
+ xmlChar *type;
+ type =
xmlGetProp(val, "type");
+ if(strstr(type,
":Array"))
+ isarray
= 1;
+ xmlFree(type);
+ }
+
tmp =
master_to_zval(NULL, val);
- if (val->name) {
+ if (val->name &&
!isarray) {
add_assoc_zval(return_value, (char*)val->name, tmp);
} else {
add_next_index_zval(return_value, tmp);
Reproduce code:
---------------
Here is an example of soap return xml:
<soapenc:Array soapenc:arrayType="xsd:anyType[4]"
xsi:type="soapenc:Array"><item
xsi:type="xsd:long">17326080650</item><item
xsi:type="xsd:int">1</item><item xsi:type="xsd:float">1.99</item><item
xsi:type="xsd:int">0</item></soapenc:Array><soapenc:Array
soapenc:arrayType="xsd:anyType[4]" xsi:type="soapenc:Array"><item
xsi:type="xsd:long">17325882599</item><item
xsi:type="xsd:int">1</item><item xsi:type="xsd:float">1.99</item><item
xsi:type="xsd:int">0</item></soapenc:Array>
Expected result:
----------------
Array => (
[0] => Array => (
[0] => 17326080650
[1] => 1
[2] => 1.99
[3] => 0
)
[1] => Array => (
[0] => 17325882599
[1] => 1
[2] => 1.99
[3] => 0
)
)
Actual result:
--------------
Array => (
[Array] => Array => (
[0] => 17325882599
[1] => 1
[2] => 1.99
[3] => 0
)
)
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=39121&edit=1[/url]
dmitry@php.net Guest
-
sos at sokhapkin dot dyndns dot org #4
#39121 [Fbk->Opn]: Incorrect return array handling in non-wsdl soap client.
ID: 39121
User updated by: sos at sokhapkin dot dyndns dot org
Reported By: sos at sokhapkin dot dyndns dot org
-Status: Feedback
+Status: Open
Bug Type: SOAP related
Operating System: Gentoo linux
PHP Version: 5.1.6
Assigned To: dmitry
New Comment:
I emailed the soap message, the bugtracker did not accept
it.
Previous Comments:
------------------------------------------------------------------------
[2006-10-23 06:46:27] [email]dmitry@php.net[/email]
I cannot analyze the report without full SOAP Envelope. I fixed one bug
related to this report, but I cannot be sure that it fixes your issue.
(Your pathch is completly wrong).
------------------------------------------------------------------------
[2006-10-10 22:42:36] [email]tony2001@php.net[/email]
Assigned to the maintainer.
------------------------------------------------------------------------
[2006-10-10 22:32:38] sos at sokhapkin dot dyndns dot org
Description:
------------
Return soap type array needs special handling in non-wsdl mode. The
return array should have numeric indexes only because all elements of
returned array have the same name.
Here is the pacth to fix the problem:
--- php_packet_soap.c.orig 2006-01-01 07:50:13.000000000 -0500
+++ php_packet_soap.c 2006-10-10 17:50:50.000000000 -0400
@@ -338,9 +338,18 @@
if (val != NULL) {
if
(!node_is_equal_ex(val,"result",RPC_SOAP12_NAMESPA CE)) {
zval *tmp;
+ int isarray = 0;
+ if(xmlHasProp(val,
"type")) {
+ xmlChar *type;
+ type =
xmlGetProp(val, "type");
+ if(strstr(type,
":Array"))
+ isarray
= 1;
+ xmlFree(type);
+ }
+
tmp =
master_to_zval(NULL, val);
- if (val->name) {
+ if (val->name &&
!isarray) {
add_assoc_zval(return_value, (char*)val->name, tmp);
} else {
add_next_index_zval(return_value, tmp);
Reproduce code:
---------------
Here is an example of soap return xml:
<soapenc:Array soapenc:arrayType="xsd:anyType[4]"
xsi:type="soapenc:Array"><item
xsi:type="xsd:long">17326080650</item><item
xsi:type="xsd:int">1</item><item xsi:type="xsd:float">1.99</item><item
xsi:type="xsd:int">0</item></soapenc:Array><soapenc:Array
soapenc:arrayType="xsd:anyType[4]" xsi:type="soapenc:Array"><item
xsi:type="xsd:long">17325882599</item><item
xsi:type="xsd:int">1</item><item xsi:type="xsd:float">1.99</item><item
xsi:type="xsd:int">0</item></soapenc:Array>
Expected result:
----------------
Array => (
[0] => Array => (
[0] => 17326080650
[1] => 1
[2] => 1.99
[3] => 0
)
[1] => Array => (
[0] => 17325882599
[1] => 1
[2] => 1.99
[3] => 0
)
)
Actual result:
--------------
Array => (
[Array] => Array => (
[0] => 17325882599
[1] => 1
[2] => 1.99
[3] => 0
)
)
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=39121&edit=1[/url]
sos at sokhapkin dot dyndns dot org Guest
-
hpuiu at xentra dot ro #5
#39121 [Com]: Incorrect return array handling in non-wsdl soap client.
ID: 39121
Comment by: hpuiu at xentra dot ro
Reported By: sos at sokhapkin dot dyndns dot org
Status: Open
Bug Type: SOAP related
Operating System: Gentoo linux
PHP Version: 5.1.6
Assigned To: dmitry
New Comment:
Hi,
I am using PHP 5.1.6 on Windows XP and I have also
encountered this issue while trying to work with
DIDX.org SOAP. There are functions that should return
arrays, but instead, all I get is an array that contains
the last record and not a multidimensional array as
I expect. I have downloaded PHP 5.2-dev and the problem is
still there.
Puiu Hrenciuc
Previous Comments:
------------------------------------------------------------------------
[2006-10-23 15:07:46] sos at sokhapkin dot dyndns dot org
I emailed the soap message, the bugtracker did not accept
it.
------------------------------------------------------------------------
[2006-10-23 06:46:27] [email]dmitry@php.net[/email]
I cannot analyze the report without full SOAP Envelope. I fixed one bug
related to this report, but I cannot be sure that it fixes your issue.
(Your pathch is completly wrong).
------------------------------------------------------------------------
[2006-10-10 22:42:36] [email]tony2001@php.net[/email]
Assigned to the maintainer.
------------------------------------------------------------------------
[2006-10-10 22:32:38] sos at sokhapkin dot dyndns dot org
Description:
------------
Return soap type array needs special handling in non-wsdl mode. The
return array should have numeric indexes only because all elements of
returned array have the same name.
Here is the pacth to fix the problem:
--- php_packet_soap.c.orig 2006-01-01 07:50:13.000000000 -0500
+++ php_packet_soap.c 2006-10-10 17:50:50.000000000 -0400
@@ -338,9 +338,18 @@
if (val != NULL) {
if
(!node_is_equal_ex(val,"result",RPC_SOAP12_NAMESPA CE)) {
zval *tmp;
+ int isarray = 0;
+ if(xmlHasProp(val,
"type")) {
+ xmlChar *type;
+ type =
xmlGetProp(val, "type");
+ if(strstr(type,
":Array"))
+ isarray
= 1;
+ xmlFree(type);
+ }
+
tmp =
master_to_zval(NULL, val);
- if (val->name) {
+ if (val->name &&
!isarray) {
add_assoc_zval(return_value, (char*)val->name, tmp);
} else {
add_next_index_zval(return_value, tmp);
Reproduce code:
---------------
Here is an example of soap return xml:
<soapenc:Array soapenc:arrayType="xsd:anyType[4]"
xsi:type="soapenc:Array"><item
xsi:type="xsd:long">17326080650</item><item
xsi:type="xsd:int">1</item><item xsi:type="xsd:float">1.99</item><item
xsi:type="xsd:int">0</item></soapenc:Array><soapenc:Array
soapenc:arrayType="xsd:anyType[4]" xsi:type="soapenc:Array"><item
xsi:type="xsd:long">17325882599</item><item
xsi:type="xsd:int">1</item><item xsi:type="xsd:float">1.99</item><item
xsi:type="xsd:int">0</item></soapenc:Array>
Expected result:
----------------
Array => (
[0] => Array => (
[0] => 17326080650
[1] => 1
[2] => 1.99
[3] => 0
)
[1] => Array => (
[0] => 17325882599
[1] => 1
[2] => 1.99
[3] => 0
)
)
Actual result:
--------------
Array => (
[Array] => Array => (
[0] => 17325882599
[1] => 1
[2] => 1.99
[3] => 0
)
)
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=39121&edit=1[/url]
hpuiu at xentra dot ro Guest
-
dmitry@php.net #6
#39121 [Opn->Csd]: Incorrect return array handling in non-wsdl soap client.
ID: 39121
Updated by: [email]dmitry@php.net[/email]
Reported By: sos at sokhapkin dot dyndns dot org
-Status: Open
+Status: Closed
Bug Type: SOAP related
Operating System: Gentoo linux
PHP Version: 5.1.6
Assigned To: dmitry
New Comment:
The bug is fixed in CVS HEAD and PHP_5_2.
Previous Comments:
------------------------------------------------------------------------
[2006-11-01 16:55:32] hpuiu at xentra dot ro
Hi,
I am using PHP 5.1.6 on Windows XP and I have also
encountered this issue while trying to work with
DIDX.org SOAP. There are functions that should return
arrays, but instead, all I get is an array that contains
the last record and not a multidimensional array as
I expect. I have downloaded PHP 5.2-dev and the problem is
still there.
Puiu Hrenciuc
------------------------------------------------------------------------
[2006-10-23 15:07:46] sos at sokhapkin dot dyndns dot org
I emailed the soap message, the bugtracker did not accept
it.
------------------------------------------------------------------------
[2006-10-23 06:46:27] [email]dmitry@php.net[/email]
I cannot analyze the report without full SOAP Envelope. I fixed one bug
related to this report, but I cannot be sure that it fixes your issue.
(Your pathch is completly wrong).
------------------------------------------------------------------------
[2006-10-10 22:42:36] [email]tony2001@php.net[/email]
Assigned to the maintainer.
------------------------------------------------------------------------
[2006-10-10 22:32:38] sos at sokhapkin dot dyndns dot org
Description:
------------
Return soap type array needs special handling in non-wsdl mode. The
return array should have numeric indexes only because all elements of
returned array have the same name.
Here is the pacth to fix the problem:
--- php_packet_soap.c.orig 2006-01-01 07:50:13.000000000 -0500
+++ php_packet_soap.c 2006-10-10 17:50:50.000000000 -0400
@@ -338,9 +338,18 @@
if (val != NULL) {
if
(!node_is_equal_ex(val,"result",RPC_SOAP12_NAMESPA CE)) {
zval *tmp;
+ int isarray = 0;
+ if(xmlHasProp(val,
"type")) {
+ xmlChar *type;
+ type =
xmlGetProp(val, "type");
+ if(strstr(type,
":Array"))
+ isarray
= 1;
+ xmlFree(type);
+ }
+
tmp =
master_to_zval(NULL, val);
- if (val->name) {
+ if (val->name &&
!isarray) {
add_assoc_zval(return_value, (char*)val->name, tmp);
} else {
add_next_index_zval(return_value, tmp);
Reproduce code:
---------------
Here is an example of soap return xml:
<soapenc:Array soapenc:arrayType="xsd:anyType[4]"
xsi:type="soapenc:Array"><item
xsi:type="xsd:long">17326080650</item><item
xsi:type="xsd:int">1</item><item xsi:type="xsd:float">1.99</item><item
xsi:type="xsd:int">0</item></soapenc:Array><soapenc:Array
soapenc:arrayType="xsd:anyType[4]" xsi:type="soapenc:Array"><item
xsi:type="xsd:long">17325882599</item><item
xsi:type="xsd:int">1</item><item xsi:type="xsd:float">1.99</item><item
xsi:type="xsd:int">0</item></soapenc:Array>
Expected result:
----------------
Array => (
[0] => Array => (
[0] => 17326080650
[1] => 1
[2] => 1.99
[3] => 0
)
[1] => Array => (
[0] => 17325882599
[1] => 1
[2] => 1.99
[3] => 0
)
)
Actual result:
--------------
Array => (
[Array] => Array => (
[0] => 17325882599
[1] => 1
[2] => 1.99
[3] => 0
)
)
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=39121&edit=1[/url]
dmitry@php.net Guest



Reply With Quote

