我正在嘗試使用soap示例工作一個php web服務,但是出現此錯誤,我不知道這是什麼意思?你能幫我嗎?謝謝。致命錯誤:未捕獲SoapFault異常:[客戶端] DTD不受SOAP支持
以下是完整的錯誤:
Fatal error: Uncaught SoapFault exception: [Client] DTD are not supported by SOAP in C:\Program Files (x86)\EasyPHP-5.3.9\www\istemci.php:3
Stack trace:
#0 C:\Program Files (x86)\EasyPHP-5.3.9\www\istemci.php(3): SoapClient->__call('gonder', Array)
#1 C:\Program Files (x86)\EasyPHP-5.3.9\www\istemci.php(3): SoapClient->gonder('mesaj', 'konu', 'kime')
#2 {main}
thrown in C:\Program Files (x86)\EasyPHP-5.3.9\www\istemci.php on line 3
這裏是我的server.php代碼:
<?php
$istemci=new SoapClient(null,array ('uri'=>'http://ersindogan-testuri','location'=>'http://localhost/test/sunucu.php'));
var_dump ($istemci->gonder('mesaj','konu','kime'));
?>
這裏是client.php代碼:
<?php
class SMS {
public function gonder($mesaj,$konu,$kime){
return 'mesaj gonderildi';
}
}
$sunucu=new SoapServer(null,array ('uri'=>'http://ersindogan-testuri'));
$sunucu->setClass('SMS');
$sunucu->handle();
嘗試傳遞單個參數而不是Array – 2012-07-09 11:24:41
使用'try {} catch()'contsruction來捕獲'SoapFault'異常,然後'var_dump();'它。您會在輸出數組的'faultstring'索引中找到mpre info。 – 2012-07-09 12:45:19
我添加了我的代碼。你能再看一遍嗎? – 2012-07-10 07:14:50