Example #1
0
 public function searchRecord()
 {
     if (!empty($_POST['rcd'])) {
         //查找record记录过程
         try {
             header("Content-Type:text/html;charset=utf-8");
             /*
              * 指定WebService路径并初始化一个WebService客户端
              */
             if (!class_exists('SoapClient')) {
                 $this->ajaxReturn(json_decode("You haven't installed the PHP-Soap module."), 'error', 0);
             }
             $ws = C('SERVICE_URL') . "/dnspro_soap/services/record?wsdl";
             //webservice服务的地址
             //print_r($ws);exit();
             $client = new SoapClient($ws);
             //$client = new SoapClient(null,array('location'=>'/dnspro_soap/services',uri => 'record'));
             /*
              * 获取SoapClient对象引用的服务所提供的所有方法
              */
             //var_dump ($client->__getFunctions());//获取服务器上提供的方法
             //var_dump ($client->__getTypes());//获取服务器上数据类型
             $result = $client->get_domain_records($_POST['rcd']);
             //查询
             $this->ajaxReturn(json_decode($result), 'success', 1);
             //json_decode()
         } catch (SOAPFault $e) {
             $this->ajaxReturn($e, 'error', 0);
         }
     }
 }