Bug #39179 [Com]: Abstract types not handled by SoapClient in WSDL mode
| From: | virann20 at gmail dot com | Date: | Thu, 09 Apr 2020 00:44:33 +0000 |
| Subject: | Bug #39179 [Com]: Abstract types not handled by SoapClient in WSDL mode | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-226497@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=39179&edit=1
ID: 39179
Comment by: virann20 at gmail dot com
Reported by: jchernia at netsuite dot com
Summary: Abstract types not handled by SoapClient in WSDL
mode
Status: No Feedback
Type: Bug
Package: SOAP related
Operating System: Windows XP
PHP Version: 5.1.6
Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
I faced with this issue too, but after all it turns out that it's not a bug.
It works when all types are declared in classmap option for SoapClient constructor.
$classmap = array( 'abstractType' => abstractType::class, 'subAbstractType'
=> subAbstractType::class );
Previous Comments:
------------------------------------------------------------------------
[2018-12-04 09:15:34] shamot at neonus dot sk
This bug is still present in PHP 7.2.12. Does anyone actually working on this?
------------------------------------------------------------------------
[2015-03-26 09:34:24] bpolaszek at gmail dot com
Hi there,
PHP 5.6 is out, PHP 7 is on its way, and a decade later, the bug's still here.
I encounter it today and it's very annoying. The only way for me to communicate with a partner
is its soap server, and I'm just stuck currently.
May you have a look at it ?
Thanks,
Beno!t POLASZEK
http://b.polaszek.fr
------------------------------------------------------------------------
[2012-05-08 12:05:16] marius dot orcsik at avangate dot com
This problem is still present in PHP 5.3.12.
------------------------------------------------------------------------
[2009-08-05 17:54:50] styx31 at gmail dot com
This bug is still present in the last version.
SoapClient does not honor polymorphism correctly, with or without abstract types
Sample WSDL :
<complexType name="PersonIdentity">
<sequence>
<element name="Id" type="xsd:string" />
</sequence>
</complexType>
<complexType name="Person">
<complexContent extends="PersonIdentity">
<sequence>
<element name="Name" type="xsd:string" />
<element name="FirstName" type="xsd:string" />
</sequence>
</complexContent>
</complexType>
Operation contract :
<complexType name="CheckPerson">
<sequence>
<element name="Person" type="PersonIdentity"/>
</sequence>
</complexType>
The operation CheckPerson accepts both Person and PersonIdentity.
Despite the fact that you can create a class which correponds in PHP :
class PersonIdentity {
public $Id;
}
class Person extends PersonIdentity {
public $Name;
public $FirstName;
}
If you use a Person instance when you call CheckPerson() :
- the Person will be serialized as a PersonIdentity,
- no i:type="Person" attribute will be added to the <Person> element,
- the properties belonging to the Person class will be dropped
------------------------------------------------------------------------
[2009-06-16 06:07:08] dasteph+forum at gmail dot com
Hi,
I have pretty the same problem.
Reproducing code: http://castex.de/stuff/php-bug.txt
expected result (in error log)
------------------------------
[15-Jun-2009 16:47:29] client
[15-Jun-2009 16:47:29] server
[15-Jun-2009 16:47:29] TestAbstractRequest Object
(
[element] => Child Object
(
[name] => test
)
)
actual result
-------------
[15-Jun-2009 16:47:29] client
[15-Jun-2009 16:47:29] server
[15-Jun-2009 16:47:29] TestAbstractRequest Object
(
[element] => Father Object
(
[name] => test
[number] => 5
)
)
Regards
Stephan
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=39179
--
Edit this bug report at https://bugs.php.net/bug.php?id=39179&edit=1