php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38701 SoapClient returns wrong class (soap inheritance)
Submitted: 2006-09-03 15:19 UTC Modified: 2006-09-12 01:00 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: chmt at gmx dot net Assigned: dmitry (profile)
Status: No Feedback Package: SOAP related
PHP Version: 5.1.6 OS: Windows 2003 server
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: chmt at gmx dot net
New email:
PHP Version: OS:

 

 [2006-09-03 15:19 UTC] chmt at gmx dot net
Description:
------------
My wsdl based SoapClient returns wrong/empty objects. I tried it with and without a classmap. Nothing helps. The only way to get to my Data seems to be to parse the XML Response by hand.

The WSDL can be obtained from here:
http://media3.hgkz.ch/PlayerRPC.wsdl

Reproduce code:
---------------
function createWSDLUrl($url) {
  return 'http://'.$url.'?wsdl';
}

class PlayItem {

}

class Play extends PlayItem {
  public $url;
  public $length;
  public $x;
}

$classmap = array('PlayItem'=>'PlayItem', 'Play'=>'Play');
$client = new SoapClient(createWSDLUrl($url),
                 array("location"=>"http://".$url,
 	                "connection_timeout" => 5,
 		        "uri"=>"urn:Playout",
                        "classmap"=>$classmap);

$ret = $client->getItem('localhost:18081', 0, 0);
var_dump($ret);


Expected result:
----------------
A Play object with valid data

Actual result:
--------------
A PlayItem object and no way to access the data the webservice delivered.

object(PlayItem)#4 (0) {
}

which is wrong.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-03 15:23 UTC] chmt at gmx dot net
The acutal result of course is (copy and paste error)

object(stdClass)#2 (1) {
  ["item"]=>
  object(PlayItem)#4 (0) {
  }
}
 [2006-09-04 08:34 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-09-04 10:01 UTC] chmt at gmx dot net
Makes no difference - unfortunaltely.
 [2006-09-04 10:57 UTC] dmitry@php.net
Please correct bug in your WSDL file first. It should contain

  <complexType name="Play">
   <complexContent>
    <extension base="playout:PlayItem">

instead of

  <complexType name="Play">
   <complexContent>
    <extension base="PlayItem">

If this doesn't help you, please provide server code or at least SOAP response XML.

 [2006-09-12 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 06:01:28 2024 UTC