From: matteo dot veggia at gmail dot com
Operating system: Windows
PHP version: 7.0.11
Package: SOAP related
Bug Type: Bug
Bug description:SOAP pass dictionary parameter
Description:
------------
I will be short: i have an WCF in a IIS Windows Server. This WCF host a
web service with this function:
public Dictionary<string, string> TestRoutine(Dictionary<string, string>
Data)
I calling this function with PHP with these rows:
$url = "http://testserver/test/test.svc?wsdl";
$soapClient = new SoapClient($url, array('cache_wsdl' =>
WSDL_CACHE_NONE) );
$argsSOAP = new StdClass();
$argsSOAP->Data = Array();
array_push($argsSOAP->Data, Array("Key"=>"A",
"Value"=>"1"));
array_push($argsSOAP->Data, Array("Key"=>"B",
"Value"=>"2"));
$resSOAP = $soapClient->TestRoutine($argsSOAP);
print_r($resSOAP);
In PHP 5.6.X these rows works! In PHP 7.0.11 NO! The "Data" parameter
result empty
BUT
If I put the values into the dictionary with a direct assignment, not
using "array_push":
$url = "http://testserver/test/test.svc?wsdl";
$soapClient = new SoapClient($url, array('cache_wsdl' =>
WSDL_CACHE_NONE) );
$argsSOAP = new StdClass();
$argsSOAP->Data = Array();
$argsSOAP->Data[0] = Array("Key"=>"A",
"Value"=>"1");
$argsSOAP->Data[1] = Array("Key"=>"B",
"Value"=>"2");
$resSOAP = $soapClient->TestRoutine($argsSOAP);
print_r($resSOAP);
IT WORKS!!! Why?
Can you check? My PHP application is all based with array_push. Please
help
Thanks
Matteo V.
Test script:
---------------
$url = "http://testserver/test/test.svc?wsdl";
$soapClient = new SoapClient($url, array('cache_wsdl' =>
WSDL_CACHE_NONE) );
$argsSOAP = new StdClass();
$argsSOAP->Data = Array();
array_push($argsSOAP->Data, Array("Key"=>"A",
"Value"=>"1"));
array_push($argsSOAP->Data, Array("Key"=>"B",
"Value"=>"2"));
$resSOAP = $soapClient->TestRoutine($argsSOAP);
print_r($resSOAP);
--
Edit bug report at https://bugs.php.net/bug.php?id=73089&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73089&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73089&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73089&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73089&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73089&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73089&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73089&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73089&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73089&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73089&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73089&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73089&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73089&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73089&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73089&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73089&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73089&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73089&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73089&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73089&r=mysqlcfg