php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37790 SOAP response for associative array is different on ubuntu 6.06
Submitted: 2006-06-12 19:00 UTC Modified: 2006-06-19 14:21 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: jerome at jeremyknope dot com Assigned:
Status: Closed Package: SOAP related
PHP Version: 5.1.4 OS: kubuntu 6.06 Dapper
Private report: No CVE-ID: None
 [2006-06-12 19:00 UTC] jerome at jeremyknope dot com
Description:
------------
When upgrading to Kubuntu or Ubuntu 6.06 (or even previous 
Dapper Dragon pre-releases), SOAP extension in PHP 5.1.4 stops 
functioning the way it used to regarding the XML responses.  
Associative arrays no longer return a XML response that 
specifies type.

Reproduce code:
---------------
class MyService {
function getLists() {
   $out = array(
      array(
         'id' => 12,
         'name' => 'My New List'
      )
    );
   return $out;
}
}
In a client page:
$result = $client->getLists();
$result will be stdClass stuff on 'broken' setup, with dapper.

Expected result:
----------------
Snippet of XML response from a $client->getLists() call:

	<SOAP-ENV:Body>
		<ns1:getListsResponse>
			<getListsReturn SOAP-ENC:arrayType="ns2:Map[1]" 
xsi:type="SOAP-ENC:Array">
				<item xsi:type="ns2:Map">
					<item>
						<key xsi:type="xsd:string">id</key>
						<value xsi:type="xsd:string">12</
value>
					</item>
					<item>
						<key xsi:type="xsd:string">name</
key>
						<value xsi:type="xsd:string">My New 
List</value>
					</item>
				</item>
			</getListsReturn>
		</ns1:getListsResponse>
	</SOAP-ENV:Body>
Result variable should be:
Array
(
    [0] => Array
        (
            [id] => 12
            [name] => My New List
        )

)

Actual result:
--------------
Actual result, missing type attributes:
	<SOAP-ENV:Body>
		<ns1:getListsResponse>
			<getListsReturn>
				<item>
					<item>
						<key>id</key>
						<value>12</value>
					</item>
					<item>
						<key>name</key>
						<value>My New List</value>
					</item>
				</item>
			</getListsReturn>
		</ns1:getListsResponse>
	</SOAP-ENV:Body>
Actual $result variable on dapper:
stdClass Object
(
    [item] => stdClass Object
        (
            [item] => Array
                (
                    [0] => stdClass Object
                        (
                            [key] => id
                            [value] => 20
                        )

                    [1] => stdClass Object
                        (
                            [key] => name
                            [value] => Test Site List
                        )

                )

        )

)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-12 19:08 UTC] jerome at jeremyknope dot com
Just wanted to add that I fiddled around with this quite a bit 
before dapper was out, basically I only could fine that 
libxml2 was used by SOAP and different versions of libxml2 
didn't change behavior.  Guessing SOAP extension is behaving 
weird due to some other system library that's commonly used.  
Re-compiling SOAP extension and PHP was something I tried but 
had no affect. this iteration was the already installed PHP 
that I built while in ubuntu breezy 5.10
 [2006-06-13 13:28 UTC] m dot leuffen at i-line dot net
Hi,

since updating to PHP 5.1.4 on Debian my Java Client refuses operations returning complex data-types:

Exception from Netbeans Web Service Client:
--
Runtime exception; nested exception is: Invalid Array-Type: 'arraytype'
--

With PHP 5.1.2 this worked fine.

To me it seems as if PHP encodes the wrong way if a Struct contains a array of Basic Datatypes.

Bye,
  Matthias
 [2006-06-19 12:45 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2006-06-19 13:53 UTC] jerome at jeremyknope dot com
Excellent, the PHP 5.2 cvs snapshot you linked successfully 
handled my SOAP service that was breaking with 5.1.4 on 
Dapper.  Glad to see this is resolved in future release of 
PHP.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 15:01:33 2024 UTC