Bug #71763 [NEW]: Soap failed if param WAS reference

From: Date: Thu, 10 Mar 2016 02:56:33 +0000
Subject: Bug #71763 [NEW]: Soap failed if param WAS reference
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199717@lists.php.net to get a copy of this message
From:             ppbg at andreika dot info
Operating system: linux
PHP version:      7.0.4
Package:          Arrays related
Bug Type:         Bug
Bug description:Soap failed if param WAS reference

Description:
------------
I got strange behavour in soap extension but I think it is not
soap-related.

If I call soap method with "complex" params I lost some tags in request
( it can be invalid and dropped while wsdl schema validation ? ) if that
param was reference

reproduced in ubuntu and centos (remi package) with 7.0.3 and 7.0.4

Test script:
---------------
$client = new \SoapClient('WebStoreWS.xml', [
            'trace' => true,
        ]);
$params = [
  'p' => [
    'param1' => 'OK',
    'param2' => [
      'item' => 1,
      'item2' => 2
    ]
  ]
];

if ( MAKEREF || UNLINKIT || FIXME) {
  // make ref
  $p = &$array['p']['param2'];
  if ( UNLINKIT) {
     //remove ref
     unset($p);
  }
  if (FIXME) {
// "touch" any key of array to fix problem
   $array['p']['param2']['item'] =
$array['p']['param2']['item'];
 }
} 



try {
  $client->myFunc($params);
} catch(\Exception $e) {
  echo $client->__getLastRequest();
}

Expected result:
----------------
// it works in php5.6 (all params) and php7.0.4 with !MAKEREF OR FIXME=
true
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope ...>
  <p>
    <param1>OK</param1>
    <param2>
      <item>1</item>
      <item2>2</item2>
    </param2>
  </p>
</SOAP-ENV>

Actual result:
--------------
// it fails in php7.0.4 with MAKEREF AND !FIXME
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope ...>
  <p>
    <param1>OK</param1>
  </p>
</SOAP-ENV>

so if we made a reference in subarray of params we got problems even
unlink reference. But if we change any param of subarray (even on the
same value) the problem will be fixed. 

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



Thread (6 messages)

« previous php.bugs (#199717) next »