#36575 [Asn->Csd]: Incorrect complex type instantiation with hierarchies
| From: | dmitry@php.net | Date: | Fri, 03 Mar 2006 09:21:25 +0000 |
| Subject: | #36575 [Asn->Csd]: Incorrect complex type instantiation with hierarchies | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-93874@lists.php.net to get a copy of this message | ||
ID: 36575
Updated by: dmitry@php.net
Reported By: hjiverson at plauditdesign dot com
-Status: Assigned
+Status: Closed
Bug Type: SOAP related
Operating System: Gentoo Linux 2.6, Windows XP SP2
PHP Version: 5.1.2
Assigned To: dmitry
New Comment:
Dixed in CVS HEAD and PHP_5_1.
Previous Comments:
------------------------------------------------------------------------
[2006-03-01 17:55:07] hjiverson at plauditdesign dot com
Description:
------------
The client and server always try to instantiate the base XSD type
defined in a hierarchy.
For example: A3 extends A2, A2 extends A1. function returnA2(), which
is mapped to return A2 in WSDL, returns an instance of A3 (which is
legal, since A3 is an A2). SOAP tries to create an A1, even though it
is actually an instance of A3. If A1 is not defined in the class map,
SOAP returns an A2, which is also not correct.
The correct behavior would be (like Axis) to map and return an A3--the
exact type the instance is mapped to--as long as it is instanceof A2.
Reproduce code:
---------------
http://dev.plauditdesign.com/~hjiverson/php-soap-bug.txt
Expected result:
----------------
Response:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:test.soap#" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns2="urn:test.soap.types#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:testResponse><result
xsi:type="ns2:A3"><var1 xsi:type="xsd:string">one</var1><var2
xsi:type="xsd:string">var two</var2><var3
xsi:type="xsd:string">var
three</var3></result></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
Actual result:
--------------
Response:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Cannot
instantiate abstract class
CT_A1</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36575&edit=1