#39121 [NEW]: Incorrect return array handling in non-wsdl soap client.

Posted: 10-10-2006, 10:32 PM
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 http://bugs.php.net/?id=39121&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39121&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39121&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39121&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39121&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=39121&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39121&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39121&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39121&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39121&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39121&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=39121&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=39121&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39121&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39121&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39121&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39121&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39121&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39121&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39121&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39121&r=mysqlcfg
Reply With Quote

Responses to "#39121 [NEW]: Incorrect return array handling in non-wsdl soap client."

tony2001@php.net
Guest
Posts: n/a
 
#39121 [Opn->Asn]: Incorrect return array handling in non-wsdl soap client.
Posted: 10-10-2006, 10:42 PM
ID: 39121
Updated by: tony2001@php.net
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 http://bugs.php.net/?id=39121&edit=1
Reply With Quote
dmitry@php.net
Guest
Posts: n/a
 
#39121 [Asn->Fbk]: Incorrect return array handling in non-wsdl soap client.
Posted: 10-23-2006, 06:46 AM
ID: 39121
Updated by: dmitry@php.net
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] tony2001@php.net

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 http://bugs.php.net/?id=39121&edit=1
Reply With Quote
sos at sokhapkin dot dyndns dot org
Guest
Posts: n/a
 
#39121 [Fbk->Opn]: Incorrect return array handling in non-wsdl soap client.
Posted: 10-23-2006, 03:07 PM
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] dmitry@php.net

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] tony2001@php.net

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 http://bugs.php.net/?id=39121&edit=1
Reply With Quote
hpuiu at xentra dot ro
Guest
Posts: n/a
 
#39121 [Com]: Incorrect return array handling in non-wsdl soap client.
Posted: 11-01-2006, 03:55 PM
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] dmitry@php.net

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] tony2001@php.net

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 http://bugs.php.net/?id=39121&edit=1
Reply With Quote
dmitry@php.net
Guest
Posts: n/a
 
#39121 [Opn->Csd]: Incorrect return array handling in non-wsdl soap client.
Posted: 11-06-2006, 03:38 PM
ID: 39121
Updated by: dmitry@php.net
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] dmitry@php.net

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] tony2001@php.net

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 http://bugs.php.net/?id=39121&edit=1
Reply With Quote
 
LinkBack Thread Tools Search this Thread Display Modes
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
#39094 [NEW]: Soap client on https webmaster at realtime dot ro PHP Bugs 1 10-09-2006 03:40 PM
#38869 [NEW]: incorrect SOAP request when operation does not require any arguments lindalj at yahoo-inc dot com PHP Bugs 1 09-18-2006 05:06 PM
Problem with .NET generated SOAP client Srikanth Subramanian ASP.NET Web Services 2 09-10-2003 10:49 AM
PROBLEM: webservice, XmlNode return value, XMLSchema and WSDL g.fiorentini ASP.NET Web Services 0 09-10-2003 08:05 AM
SOAP Client creation in ASP.NET using MS SOAP Toolkit Sham Ramakrishnan ASP.NET General 2 07-01-2003 11:29 AM