php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40071 SoapServer returns 'Object hasn't xxx property' fault
Submitted: 2007-01-09 03:29 UTC Modified: 2007-02-07 01:00 UTC
Votes:13
Avg. Score:4.6 ± 0.7
Reproduced:12 of 13 (92.3%)
Same Version:5 (41.7%)
Same OS:3 (25.0%)
From: ville at pmd dot fi Assigned: dmitry (profile)
Status: No Feedback Package: SOAP related
PHP Version: 5.2.0 OS: Debian Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-01-09 03:29 UTC] ville at pmd dot fi
Description:
------------
SoapServer raises an 'Object hasn't xxx property' error when trying to return an object (WSDL complextype) from service class. Different methods of returning an object (array, PHP object, SoapVar with SOAP_ENC_OBJECT attribute...) ends up to the same result.

The bug is similar to an already fixed bug #30928


Reproduce code:
---------------
http://ville.mattila.fi/php/soaptestservice.phps
http://ville.mattila.fi/php/wsdl/complextypetest.wsdl

Expected result:
----------------
At the client side: a returned object with firstName and lastName elements filled with lowercase and uppercase versions of given authToken.

Actual result:
--------------
At the client side: SOAP-ERROR: Encoding: object hasn't 'firstName' property

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-09 14:26 UTC] iliaa@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


 [2007-01-17 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".
 [2007-01-23 20:48 UTC] ville at pmd dot fi
The latest snapshot doesn't fix the problem, the returned error message is still the same.
 [2007-01-26 17:30 UTC] dmitry@php.net
Fix your server code:

class testService {
  public function authUser($authToken) {
    return array(
      'firstName' => strtolower($authToken),
      'lastName' => strtoupper($authToken)
    );
  }
}

class testService2 {
  public function authUser($authToken) {
    $r = new objUserDetails();
    $r->firstName = strtolower($authToken);
    $r->lastName = strtoupper($authToken);
    return $r;
  }
}

 [2007-01-26 17:52 UTC] ville at pmd dot fi
Even fixed as asked, the server still returns the same error.
 [2007-01-30 08:57 UTC] dmitry@php.net
You probably did somthing wrong. I verified this code before sending it to you.
 [2007-02-07 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".
 [2007-02-13 17:14 UTC] davidfelton at codemasters dot com
dmitry you're saying the server code is wrong, what's wrong with it?

Is the code you posted a correction or taken from the file linked in the original post - the code is identical now but I can't tell if the file has been changed since the original posting to be what you posted as a correction, or if you are pointing out incorrect code.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Mar 02 00:01:28 2024 UTC