Heim  >  Artikel  >  Backend-Entwicklung  >  一个很奇怪的soap有关问题

一个很奇怪的soap有关问题

WBOY
WBOYOriginal
2016-06-13 10:08:131018Durchsuche

一个很奇怪的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的错误,路径是没错的呀?

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:小弟我碰到了PHP的BUG?Nächster Artikel:.htaccess文件怎么做301