Bug #73089 [ReO]: SOAP pass dictionary parameter
| From: | matteo dot veggia at gmail dot com | Date: | Tue, 13 Dec 2016 13:24:52 +0000 |
| Subject: | Bug #73089 [ReO]: SOAP pass dictionary parameter | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-205958@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
User updated by: matteo dot veggia at gmail dot com
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.1.0
Block user comment: N
Private report: N
New Comment:
I've found another element which it can explain more considerations:
If I use
$argsSOAP->Data = Array();
array_push($argsSOAP->Data, Array("Key"=>"A",
"Value"=>"1"));
array_push($argsSOAP->Data, Array("Key"=>"B",
"Value"=>"2"));
$resSOAP = $soapClient->TestRoutineDictionary($argsSOAP);
the XML is wrong (read last posts).
BUT... if I use a "support" variable called "tmparr":
$tmparr = Array();
array_push($tmparr, Array("Key"=>"A", "Value"=>"1"));
array_push($tmparr, Array("Key"=>"B", "Value"=>"2"));
$argsSOAP->Data = $tmparr;
$resSOAP = $soapClient->TestRoutineDictionary($argsSOAP);
IT WORKS!!!
Simple question... why?
Previous Comments:
------------------------------------------------------------------------
[2016-12-13 12:50:06] matteo dot veggia at gmail dot com
Same problem with PHP 7.0.14.
Have you tried my code? Have you the same problem?
------------------------------------------------------------------------
[2016-12-05 07:27:56] matteo dot veggia at gmail dot com
@sjon: the problem persist without apache, executing manually in cmd the php.exe with a php test
file.
Can you try this problem? Why you don't simulate it? It is easy, you need only an iis server, a
simple wcf and the php code.
Am I the only person who has this problem?
------------------------------------------------------------------------
[2016-12-04 15:43:05] sjon at hortensius dot net
@matteo - if the php.exe works then this is probably not a bug in php but in your apache
configuration. You should verify what dll apache uses, check your configuration for the LoadModule
call for php and make sure it looks like this:
LoadModule php7_module "c:/php/php7apache2.dll"
Obviously the php7apache2.dll you reference here should be 7.0.12 or higher. This is also explained
in the "install.txt" that is in the file you download from http://windows.php.net/download
------------------------------------------------------------------------
[2016-12-02 12:49:29] matteo dot veggia at gmail dot com
The problem persist.... Please help.
------------------------------------------------------------------------
[2016-11-14 10:45:30] matteo dot veggia at gmail dot com
The issue persists with PHP Version 7.0.13! I rewrite my code to remake the question simplified:
$url = "wwwp.example.com/hello.svc?wdsl";
$options = Array("trace"=>1);
//FIRST METHOD!!! (not working)
$soapClient = new SoapClient($url, $options);
$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->TestRoutineDictionary($argsSOAP);
echo "REQUEST:<br>" . htmlspecialchars(str_ireplace('><',
">\n<", $soapClient->__getLastRequest())) . "<br>";
echo "Response:<br>" . htmlspecialchars(str_ireplace('><',
">\n<", $soapClient->__getLastResponse())) . "<br>";
echo "\n\n<hr>\n\n";
//SECOND METHOD (working...)
$soapClient2 = new SoapClient($url, $options);
$argsSOAP2 = new StdClass();
$argsSOAP2->Data = Array();
$argsSOAP2->Data[0] = Array("Key"=>"A",
"Value"=>"1");
$argsSOAP2->Data[1] = Array("Key"=>"B",
"Value"=>"2");
$resSOAP2 = $soapClient2->TestRoutineDictionary($argsSOAP2);
echo "REQUEST:<br>" . htmlspecialchars(str_ireplace('><',
">\n<", $soapClient2->__getLastRequest())) . "<br>";
echo "Response:<br>" . htmlspecialchars(str_ireplace('><',
">\n<", $soapClient2->__getLastResponse())) . "<br>";
I execute this script with php.exe (without apache!)
The results are different!
In the first result is missing "http://schemas.microsoft.com/2003/10/Serialization/Arrays"...
Please help me.
Matteo
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=73089
--
Edit this bug report at https://bugs.php.net/bug.php?id=73089&edit=1