php soap问题 跪求高手解答……!!
时间:2011-03-25
来源:互联网
server端:
PHP code
client端:
PHP code
为啥客户端运行时会报错:Fatal error: Uncaught SoapFault exception: [HTTP] Not Found in D:\PHPWeb\php webservice\client.php:6 Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://localhos...', 'http://test-rui...', 1, 0) #1 D:\PHPWeb\php webservice\client.php(6): SoapClient->__call('sayhello', Array) #2 D:\PHPWeb\php webservice\client.php(6): SoapClient->sayhello('Jim') #3 {main} thrown in D:\PHPWeb\php webservice\client.php on line 6
用try catch 后 得到这个:
fault code:HTTP
fault string : Not Found
还有 能不能给我详细介绍下soapserver 跟soapclient方法里的那个array参数到底是怎么用的啊 ??
求高人帮助!!!
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",'uri'=>"http://test-rui")); $client->sayhello("Jim"); } catch (SoapFault $fault){ echo "fault code:".$fault->faultcode."<br>". "fault string : ".$fault->faultstring; } ?>
为啥客户端运行时会报错:Fatal error: Uncaught SoapFault exception: [HTTP] Not Found in D:\PHPWeb\php webservice\client.php:6 Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://localhos...', 'http://test-rui...', 1, 0) #1 D:\PHPWeb\php webservice\client.php(6): SoapClient->__call('sayhello', Array) #2 D:\PHPWeb\php webservice\client.php(6): SoapClient->sayhello('Jim') #3 {main} thrown in D:\PHPWeb\php webservice\client.php on line 6
用try catch 后 得到这个:
fault code:HTTP
fault string : Not Found
还有 能不能给我详细介绍下soapserver 跟soapclient方法里的那个array参数到底是怎么用的啊 ??
求高人帮助!!!
作者: MMDD0827 发布时间: 2011-03-25
server端有个wsdl文件,怎么没有?
作者: llj480028 发布时间: 2011-03-25
用的是代码现行模式……
现在上边问题解决啦 ,是我路径写错了
但是现在新的问题出现了 , 显示出:
fault code:Client
fault string : looks like we got no XML document
大侠 能不能告诉我这是哪错了啊 ?
现在上边问题解决啦 ,是我路径写错了
但是现在新的问题出现了 , 显示出:
fault code:Client
fault string : looks like we got no XML document
大侠 能不能告诉我这是哪错了啊 ?
作者: MMDD0827 发布时间: 2011-03-25
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28