Serialization error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi List,

I am getting this error,

The tax for Ontario Canada is array(4) { ["faultcode"]=> string(6) "Server"
["faultactor"]=> string(0) "" ["faultstring"]=> string(26) "unable to
serialize result" ["detail"]=> string(0) "" }

Here is the Server side code

<?php

require_once('nusoap.php');
$ns="http://localhost/webservice3";;

$server = new soap_server();
$server->configureWSDL('CanadaTaxCalculator',$ns);
$server->wsdl->schemaTargetNamespace=$ns;

$server->register('CalculateOntarioTax',
array('amount' => 'xsd:string'),
array('return' => 'xsd:string'),
$ns);

function CalculateOntarioTax($amount){
$taxcalc=$amount*.15;
return new soapval('return','string',$taxcalc);
}

$server->service($HTTP_RAW_POST_DATA);


?>

And here is the client code


<?php

require_once('../lib/nusoap.php');
require_once('class.soapclientJ.php');
$wsdl="http://localhost/webservice3/TaxCalc.php?wsdl";;
$client=new soapclientJ($wsdl, array('wsdl'));
$param=array('amount'=>'15.00',);
echo "The tax for Ontario Canada is\n";
var_dump ($client->call('CalculateOntarioTax', $param));
?>

Can any one tell me why i am getting the error?

This was supposed to work as i just took the code off from the website

http://www.xml.com/pub/a/ws/2004/03/24/phpws.html

Thanks for the help


--
"Windows [n.]
A thirty-two bit extension and GUI shell to a sixteen bit patch to an eight
bit operating system originally coded for a four bit microprocessor and sold
by a two-bit company that can't stand one bit of competition."

[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux