一个很奇怪的soap有关问题
程序员文章站
2022-05-31 14:03:16
...
一个很奇怪的soap问题
新装的系统,apache根目录在/var/www/html下,
phpclient.php代码:
ini_set('display_errors', 1);
error_reporting(E_ALL);
$soap = new SoapClient("http://localhost/soap.wsdl");
var_dump ( $soap->__getFunctions () );
echo $soap->Add(1,2);
?>
soap.php代码:
class service
{
public function HelloWorld()
{
return "Hello";
}
public function Add($a,$b)
{
return $a+$b;
}
}
$server=new SoapServer("http://localhost/soap.wsdl",array('soap_version' => SOAP_1_2));
$server->setClass("service");
$server->handle();
?>
soap.wsdl代码:
一开赛的时候我是把soap.wsdl放在/var/www/html/wsdl文件夹里面的,原来的"http://localhost/soap.wsdl"为"http://localhost/wsdl/soap.wsdl" 可是不知道为什么报:Fatal error: Uncaught SoapFault exception: [HTTP] Not Found in的错误,路径是没错的呀?
新装的系统,apache根目录在/var/www/html下,
phpclient.php代码:
ini_set('display_errors', 1);
error_reporting(E_ALL);
$soap = new SoapClient("http://localhost/soap.wsdl");
var_dump ( $soap->__getFunctions () );
echo $soap->Add(1,2);
?>
soap.php代码:
class service
{
public function HelloWorld()
{
return "Hello";
}
public function Add($a,$b)
{
return $a+$b;
}
}
$server=new SoapServer("http://localhost/soap.wsdl",array('soap_version' => SOAP_1_2));
$server->setClass("service");
$server->handle();
?>
soap.wsdl代码:
一开赛的时候我是把soap.wsdl放在/var/www/html/wsdl文件夹里面的,原来的"http://localhost/soap.wsdl"为"http://localhost/wsdl/soap.wsdl" 可是不知道为什么报:Fatal error: Uncaught SoapFault exception: [HTTP] Not Found in的错误,路径是没错的呀?
相关文章
相关视频