nusoap简单服务器
您好,我正在使用此代码作为 nusoap 服务器,但是当我在 Web 浏览器中调用服务器时,它显示消息“此服务不提供 Web 描述”这是代码
<?
//call library
require_once ('lib/nusoap.php');
//using soap_server to create server object
$server = new soap_server;
//register a function that works on server
$server->register('hello');
// create the function
function hello($name)
{
if(!$name){
return new soap_fault('Client','','Put your name!');
}
$result = "Hello, ".$name;
return $result;
}
// create HTTP listener
$server->service($HTTP_RAW_POST_DATA);
exit();
?>
帮助...
Hi i am using this code for nusoap server but when i call the server in web browser it shows message "This service does not provide a Web description" Here is the code
<?
//call library
require_once ('lib/nusoap.php');
//using soap_server to create server object
$server = new soap_server;
//register a function that works on server
$server->register('hello');
// create the function
function hello($name)
{
if(!$name){
return new soap_fault('Client','','Put your name!');
}
$result = "Hello, ".$name;
return $result;
}
// create HTTP listener
$server->service($HTTP_RAW_POST_DATA);
exit();
?>
An help ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
请将您的代码更改为,
您没有定义命名空间。
请在此处查看简单示例:-
http://patelmilap.wordpress.com/2011/09/01/soap-simple-object-access-protocol/
Please change your code to,
You didnt Define namespace..
Please see simple example here :-
http://patelmilap.wordpress.com/2011/09/01/soap-simple-object-access-protocol/
Web 浏览器未调用 Web 服务 - 您可以创建一个 PHP 客户端:
这应该显示
Hello, StackOverFlow
更新
要创建 WSDL,您需要添加以下内容:
The web browser is not calling the Web service - you could create a PHP client :
This should display
Hello, StackOverFlow
Update
To create a WSDL you need to add the following :
您还可以使用 nusoap_client
You can also use nusoap_client