Bug #69280 [NEW]: SoapClient classmap doesn't support fully qualified class name

From: Date: Mon, 23 Mar 2015 14:24:40 +0000
Subject: Bug #69280 [NEW]: SoapClient classmap doesn't support fully qualified class name
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191546@lists.php.net to get a copy of this message
From:             champetier dot etienne at gmail dot com
Operating system: 
PHP version:      5.6.7
Package:          SOAP related
Bug Type:         Bug
Bug description:SoapClient classmap doesn't support fully qualified class name

Description:
------------
If you have in your wsdl an object that extends another one
(xs:extension)(RealClass1 extends AbstractClass in my case),
then your call will succeed (soap call containing xsi:type=RealClass1)
if you have in your classmap:
'RealClass1' => 'RealClass1'
but will fail (RealClass1 casted to AbstractClass) if you have:
'RealClass1' => '\RealClass1'

Same thing with namespaces:
'RealClass1' => 'myNS\RealClass1' works
'RealClass1' => '\myNS\RealClass1' doesn't work

Test script:
---------------
https://github.com/echampet/php-soapclient-classmap-bug/tree/6107d546bef50e31e1866800398a861eebeaf7d9


Expected result:
----------------
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://tempuri.org/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:TestMethod>
<ns1:testObj xsi:type="ns1:RealClass1">
<ns1:prop>prop</ns1:prop>
<ns1:prop1>prop1</ns1:prop1>
</ns1:testObj>
</ns1:TestMethod>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

(with xsi:type="ns1:RealClass1", and prop1)

Actual result:
--------------
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://tempuri.org/">
<SOAP-ENV:Body>
<ns1:TestMethod>
<ns1:testObj>
<ns1:prop>prop</ns1:prop>
</ns1:testObj>
</ns1:TestMethod>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

(testObj is downcasted from RealClass1 to AbstractClass and looses
prop1)
(prop is a property of AbstractClass, prop1 property of RealClass1)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=69280&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=69280&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=69280&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=69280&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=69280&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=69280&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=69280&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=69280&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=69280&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=69280&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=69280&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=69280&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=69280&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=69280&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69280&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=69280&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=69280&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=69280&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69280&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=69280&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=69280&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#191546) next »