当前位置: 首页>>代码示例>>PHP>>正文


PHP XMLParser::deserializeXml方法代码示例

本文整理汇总了PHP中XMLParser::deserializeXml方法的典型用法代码示例。如果您正苦于以下问题:PHP XMLParser::deserializeXml方法的具体用法?PHP XMLParser::deserializeXml怎么用?PHP XMLParser::deserializeXml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XMLParser的用法示例。


在下文中一共展示了XMLParser::deserializeXml方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sendHttp

 public function sendHttp($url, $connectTimeout = "", $timeout)
 {
     // verify that the URL uses a supported protocol.
     if (strpos($url, "http://") === 0 || strpos($url, "https://") === 0) {
         //Construct the payload to POST to the url.
         $data = $this->getRequestXml();
         // create a new cURL resource
         $ch = curl_init($url);
         // set URL and other appropriate options
         curl_setopt($ch, CURLOPT_POST, 1);
         curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
         curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
         curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
         // Execute the request.
         $result = curl_exec($ch);
         $succeeded = curl_errno($ch) == 0 ? true : false;
         // close cURL resource, and free up system resources
         curl_close($ch);
         // If Communication was not successful set error result, otherwise
         if (!$succeeded) {
             $result = $this->setErrorResponse(CENTINEL_ERROR_CODE_8030, CENTINEL_ERROR_CODE_8030_DESC);
         }
         // Assert that we received an expected Centinel Message in reponse.
         if (strpos($result, "<CardinalMPI>") === false) {
             $result = $this->setErrorResponse(CENTINEL_ERROR_CODE_8010, CENTINEL_ERROR_CODE_8010_DESC);
         }
     } else {
         $result = $this->setErrorResponse(CENTINEL_ERROR_CODE_8000, CENTINEL_ERROR_CODE_8000_DESC);
     }
     $parser = new XMLParser();
     $parser->deserializeXml($result);
     $this->response = $parser->deserializedResponse;
 }
开发者ID:vishalpatel14,项目名称:indiankalaniketan,代码行数:35,代码来源:Client.php


注:本文中的XMLParser::deserializeXml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。