当前位置: 代码迷 >> XML/SOAP >> (来人领分啦!),该怎么处理
  详细解决方案

(来人领分啦!),该怎么处理

热度:424   发布时间:2012-02-24 16:30:39.0
(来人领分啦!!!!!)
server端:
PHP code
<?php 

error_reporting(7);
$server=new SoapServer(null,array('uri'=>"http://test-rui"));
function sayhello($str)
{
    return "Hello ".$str;
}
$server->addFunction('sayhello');
$server->handle();

?>


client端:
PHP code
<?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;
}
?>


为啥客户端运行时会报错:fault code:Client
fault string : SoapClient::SoapClient() [soapclient.soapclient]: 'uri' option is required in nonWSDL mode

  还有 能不能给我详细介绍下soapserver 跟soapclient方法里的那个array参数到底是怎么用的啊 ??  
求高人帮助!!!

------解决方案--------------------
qqqqqqqqqqqqqqqqqqqqqqqqqq
  相关解决方案