8,906
社区成员
发帖
与我相关
我的任务
分享
<?php
error_reporting(7);
$server=new SoapServer(null,array('uri'=>"http://test-rui"));
function sayhello($str)
{
return "Hello ".$str;
}
$server->addFunction('sayhello');
$server->handle();
?>
<?php
error_reporting(7);
try{
$client=new SoapClient(null,array('location'=>"http://localhost/php webservice/server.php","http://test-rui"));
$client->sayhello("Jim");
}
catch (SoapFault $fault){
echo "fault code:".$fault->faultcode."<br>". "fault string : ".$fault->faultstring;
}
?>
try{
$client=new SoapClient(null,array('location'=>"http://localhost/php webservice/server.php","http://test-rui"));
$client->sayhello("Jim");
改成try{
$client=new SoapClient(null,array('location'=>"http://localhost/php webservice/server.php",‘uri’=>"http://test-rui"));
$client->sayhello("Jim");