致命错误:未捕获SoapFault异常:[客户端] DTD不受SOAP支持
我正在尝试使用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();
1. Check the End point URL, make sure its the right one
2. Check the SOAP header formation. Make sure you have required information, with encoding too .
3. SOAP parameters might be case sensitive
请疑难解答和回复。
谢谢。你能看看我刚刚添加的代码吗? – 2012-07-10 07:15:36
尝试传递单个参数而不是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