Re: [SOAP] How to send Hash from PHP to Perl using Soap::Lite
| From: | Shane Caraveo | Date: | Mon, 07 Oct 2002 17:56:53 +0000 |
| Subject: | Re: [SOAP] How to send Hash from PHP to Perl using Soap::Lite | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-281@lists.php.net to get a copy of this message | ||
The second parameter to call is expected to be an array of arguments, so you need to do something like:
$userinfo = array (
'USER_NAME' => "S. Sukumar",
'GROUP_NAME' => "Administrator"
);
$Result = $S->Call("User_Info",array($userinfo),"urn:Hello");
Sukumar .S wrote:
Dear all, I'm very new to SOAP. I'm using Pear::SOAP in PHP and SOAP::Lite in perl. I have to send a Hash from PHP to Perl. But when i send the hash it goes as an List. How can get the php hash as Perl Hash ?. Please Help me... with regards, S. Sukumar Here is my code on PHP SendHash.php <?php include("SOAP/Client.php");$Inputs = array ( 'USER_NAME' => "S. Sukumar", 'GROUP_NAME' => "Administrator" ); $S = new SOAP_Client("http://sukumar.bksys.co.in/cgi-bin/Hello.pl"); $Result = $S->Call("User_Info",$Inputs,"urn:Hello");print_r($Result) ?> The corresponding Perl Package Hello.pm is ------------------------------------------- package Hello; use Data::Dumper; sub User_Info { my ($Class,@Info) = @_; my $Key = ""; my $Data = ""; foreach $Key (@Info) {$Data .= $Key . ";";} return "Received the User Information $Data"; } 1;