2012-07-09 168 views
1

我正在嘗試使用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(); 
+0

嘗試傳遞單個參數而不是Array – 2012-07-09 11:24:41

+0

使用'try {} catch()'contsruction來捕獲'SoapFault'異常,然後'var_dump();'它。您會在輸出數組的'faultstring'索引中找到mpre info。 – 2012-07-09 12:45:19

+0

我添加了我的代碼。你能再看一遍嗎? – 2012-07-10 07:14:50

回答

2
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 

請疑難解答和回覆。

+0

謝謝。你能看看我剛剛添加的代碼嗎? – 2012-07-10 07:15:36

相關問題