Internal Server Error --webservice
想做一个webservice,apache+php,具体代码如下:
client.php
<?php
try
{
$client = new SoapClient(null,
array('location' =>"http://127.0.0.1/src/server.php",'uri' => "http://127.0.0.1/")
);
echo $client->minus_func(100,99);
}
catch (SoapFault $fault)
{
echo "Error: ",$fault->faultcode,", string: ",$fault->faultstring;
}
?>
server.php
<?php
$soap = new SoapServer(null,array('uri'=>"http://127.0.0.1/"));// ip.
$soap->addFunction('minus_func'); //Register the function
$soap->addFunction(SOAP_FUNCTIONS_ALL);
$soap->handle();
function minus_func($i, $j)
{
$res = $i - $j;
return $res;
}
?>
运行client.php,为什么总是提示错误:Internal Server Error???
急,求救!