doufei1852 2017-01-03 18:53
浏览 33

客户端Web服务肥皂出错

I have my web service which I am sure is good because I have been using almost the same code for another project.

<?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
    { }

}

It is echoing hi1, but not echoing hi2, hi3. I have no idea what is wrong. Can someone please help?

  • 写回答

1条回答 默认 最新

  • dongli8722 2017-01-03 20:44
    关注

    Add a

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

    After your try{} to see what exception is thrown. I would assume that the wsdl is not reachable.

    评论

报告相同问题?

悬赏问题

  • ¥15 echarts动画效果失效的问题。官网下载的例子。
  • ¥60 许可证msc licensing软件报错显示已有相同版本软件,但是下一步显示无法读取日志目录。
  • ¥15 Attention is all you need 的代码运行
  • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事:
  • ¥15 前置放大电路与功率放大电路相连放大倍数出现问题
  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加