2017-01-03 8 views
1

他のプロジェクトとほぼ同じコードを使用しているため、私のWebサービスは良いと思います。クライアントWebサービスソープのエラー

<?php 

try 
{ 

    $input=$_POST['txtInput']; 
    $wsdl='http://localhost/Search.wsdl'; 
    $options=array('cache_wsdl'=>WSDL_CACHE_NONE,'features'=>SOAP_SINGLE_ELEMENT_ARRAYS); 


    echo "hi1"; 

    $client=new SoapClient($wsdl,$options); 
    echo "hi2"; 

    $response=$client->viewHealth($input); 
    echo "hi3"; 
    if(isset($response->Health)) 
    { 

     $HTMLDocument="<!Doctype html> 
     <html> 
     <head> 
      <title>Health</title> 
      <link rel='stylesheet' type='text/css' href='style.css'/> 
     </head> 
     <body> 

      <table border='2'> 
      <thead> 
      <tr id='tabs'> 
       <th>Title</th> 
       <th>Description</th> 
       <th>Symptoms</th> 
       <th>Treatments</th> 
      </tr> 
      </thead> 
      <tbody>"; 
     foreach($response->Health as $record) 
     { 
      $HTMLDocument.="<tr><td>".$record->Title."</td>"; 
      $HTMLDocument.="<td>".$record->Description."</td>"; 
      $HTMLDocument.="<td>".$record->Symptoms."</td>"; 
      $HTMLDocument.="<td>".$record->Treatments."</td></tr>"; 
     } 
     $HTMLDocument.="</tbody></table></body></html>"; 
     echo $HTMLDocument; 
    } 
    else 
    { } 

} 

hi1をエコーし​​ますが、hi2、hi3をエコーし​​ません。何が悪いのか分かりません。誰かが助けてくれますか?

答えて

0

スローされているものを除い見るためにあなたのtry {}の後

catch (Exception $e) { 
echo $e->getMessage(); 
} 

を追加します。私はwsdlに到達できないと仮定します。

+0

私はすでにそこに1つ置いています。しかし空白のページが表示されています。 –

+0

エラー例外がスローされていません –

+0

エラーログにPHP致命的なエラーはありませんか? –

関連する問題