Bug #73089 [ReO]: SOAP pass dictionary parameter

From: Date: Mon, 17 Oct 2016 13:37:54 +0000
Subject: Bug #73089 [ReO]: SOAP pass dictionary parameter
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204864@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73089&edit=1 ID: 73089 Updated by: nikic@php.net Reported by: matteo dot veggia at gmail dot com Summary: SOAP pass dictionary parameter Status: Re-Opened Type: Bug Package: SOAP related Operating System: Windows PHP Version: 7.0.12 Block user comment: N Private report: N New Comment: This is the param encoding I get on PHP 7.0.12: <param0 xsi:type="SOAP-ENC:Struct"> <Data SOAP-ENC:arrayType="ns2:Map[2]" xsi:type="SOAP-ENC:Array"> <item xsi:type="ns2:Map"> <item> <key xsi:type="xsd:string">Key</key> <value xsi:type="xsd:string">A</value> </item> <item> <key xsi:type="xsd:string">Value</key> <value xsi:type="xsd:string">1</value> </item> </item> <item xsi:type="ns2:Map"> <item> <key xsi:type="xsd:string">Key</key> <value xsi:type="xsd:string">B</value> </item> <item> <key xsi:type="xsd:string">Value</key> <value xsi:type="xsd:string">2</value> </item> </item> </Data> </param0> Not knowing anything about SOAP specifically, it looks correct to me. Are you sure you are running PHP 7.0.12? Previous Comments: ------------------------------------------------------------------------ [2016-10-17 07:57:58] requinix@php.net Bug #73327 says this isn't resolved in 7.0.12. ------------------------------------------------------------------------ [2016-09-15 13:38:21] nikic@php.net Duplicate of bug #71996, which will be fixed in PHP 7.0.12. ------------------------------------------------------------------------ [2016-09-15 13:33:06] matteo dot veggia at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=73089&edit=1

« previous php.bugs (#204864) next »