php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30175 SOAP results aren't parsed correctly
Submitted: 2004-09-21 01:39 UTC Modified: 2004-10-05 18:03 UTC
From: waboring at 3gstech dot com Assigned: dmitry
Status: Closed Package: SOAP related
PHP Version: 5CVS-2004-09-21 (dev) OS: linux
Private report: No CVE-ID:
 [2004-09-21 01:39 UTC] waboring at 3gstech dot com
Description:
------------
I have a complex type returned in a SOAP reply and I am getting an array with null values back from the soap client.

The array that is return has the correct keys, but the values are always null.  The response has the values.  I tried this with NuSOAP and it works fine.

The NuSoap script that works is at
http://www.newsblob.com/nusoap/qweb.php

I don't have a publicly available php5 install, but here is the code that fails.

Reproduce code:
---------------
<?php
ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache

function xxx($var) {
 echo "<xmp>\n";
 print var_dump($var, TRUE);
 echo "</xmp>\n";
}

$client = new SoapClient('http://www.newsblob.com/qweb.wsdl',
                         array('trace' => 1,
                               'exceptions' => 1));
//ok try and get the host struct
$host = $client->qwebGetHostInfo();
xxx($host);


echo "<br><br>Request : ".xxx($client->__getLastRequest(), TRUE);
echo "<br>Response : ".xxx($client->__getLastResponse(), TRUE);
?>

Expected result:
----------------
I should see:

array(3) { ["name"]=>  string(25) "blah blah some name field" ["shortDescription"]=>  string(43) "This is a description. more blah blah blah" ["ipAddress"]=>  string(9) "127.0.0.1" }



Actual result:
--------------
array(3) { ["name"]=>  NULL ["shortDescription"]=> NULL ["ipAddress"]=>  NULL }

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-21 01:45 UTC] waboring at 3gstech dot com
The entire response is

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="urn:qweb"><SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" id="_0"><ns1:HostInfo xsi:type="ns1:HostInfo"><name xsi:type="xsd:string">blah blah some name field</name><shortDescription xsi:type="xsd:string">This is a description. more blah blah blah</shortDescription><ipAddress xsi:type="xsd:string">127.0.0.1</ipAddress></ns1:HostInfo></SOAP-ENV:Body></SOAP-ENV:Envelope>
 [2004-10-05 18:03 UTC] dmitry@php.net
Fixed in CVS HEAD and PHP_5_0.

But I am not sure about proper SOAP result.
From my point of view it should contain <qwebGetHostInfoResponse> instead of <HostInfo>.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 03:02:42 2014 UTC