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

Ask a Question related to PHP Bugs, Design and Development.

  1. #1

    Default #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

  2. Similar Questions and Discussions

    1. #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...
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default #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

  4. #3

    Default #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

  5. #4

    Default #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

  6. #5

    Default #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

  7. #6

    Default #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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139