(来人领分啦!!!!!)

MMDD0827 2011-03-25 03:37:15
server端:
<?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 
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参数到底是怎么用的啊 ??
求高人帮助!!!
...全文
93 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
woshichiren 2011-07-29
  • 打赏
  • 举报
回复
qqqqqqqqqqqqqqqqqqqqqqqqqq
MMDD0827 2011-03-25
  • 打赏
  • 举报
回复
为啥没人理我啊?? 我哭!!!
MMDD0827 2011-03-25
  • 打赏
  • 举报
回复
把client端的
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");

之后依然报错 !
fault code:HTTP
fault string : Not Found

求高手帮忙啊……%
MMDD0827 2011-03-25
  • 打赏
  • 举报
回复
没人顶 自己先顶一个……

8,906

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧