|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36575 Incorrect complex type instantiation with hierarchies
Submitted: 2006-03-01 17:55 UTC Modified: 2006-03-03 10:21 UTC
From: hjiverson at plauditdesign dot com Assigned: dmitry (profile)
Status: Closed Package: SOAP related
PHP Version: 5.1.2 OS: Gentoo Linux 2.6, Windows XP SP2
Private report: No CVE-ID: None
 [2006-03-01 17:55 UTC] hjiverson at plauditdesign dot com
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:

Expected result:
<?xml version="1.0" encoding="UTF-8"?>
xmlns:ns1="urn:test.soap#" xmlns:xsd="" 
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 

Actual result:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=""><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>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-03 10:21 UTC]
Dixed in CVS HEAD and PHP_5_1.
 [2017-12-21 12:19 UTC] bhavin dot zestard at gmail dot com
Here is my question
Please help
 [2017-12-21 12:22 UTC] bhavin dot zestard at gmail dot com
Sorry for previous wrong question
Here is my question for soap API call with NetSuite
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 06:01:34 2024 UTC