#36575 [NEW]: Incorrect complex type instantiation with hierarchies
| From: | hjiverson at plauditdesign dot com | Date: | Wed, 01 Mar 2006 16:55:08 +0000 |
| Subject: | #36575 [NEW]: Incorrect complex type instantiation with hierarchies | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-93806@lists.php.net to get a copy of this message | ||
From: hjiverson at plauditdesign dot com
Operating system: Gentoo Linux 2.6, Windows XP SP2
PHP version: 5.1.2
PHP Bug Type: SOAP related
Bug description: Incorrect complex type instantiation with hierarchies
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 bug report at http://bugs.php.net/?id=36575&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36575&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36575&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36575&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36575&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=36575&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36575&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36575&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36575&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36575&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36575&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=36575&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=36575&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36575&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36575&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36575&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36575&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36575&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36575&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36575&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36575&r=mysqlcfg