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


PHP nusoap_parser::getHeaders方法代码示例

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


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

示例1: parseRequest

 /**
  * processes SOAP message received from client
  *
  * @param	array	$headers	The HTTP headers
  * @param	string	$data		unprocessed request data from client
  * @return	mixed	value of the message, decoded into a PHP type
  * @access   private
  */
 function parseRequest($headers, $data)
 {
     $this->debug('Entering parseRequest() for data of length ' . strlen($data) . ' and type ' . $headers['content-type']);
     if (!strstr($headers['content-type'], 'text/xml')) {
         $this->setError('Request not of type text/xml');
         return false;
     }
     if (strpos($headers['content-type'], '=')) {
         $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
         $this->debug('Got response encoding: ' . $enc);
         if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) {
             $this->xml_encoding = strtoupper($enc);
         } else {
             $this->xml_encoding = 'US-ASCII';
         }
     } else {
         // should be US-ASCII for HTTP 1.0 or ISO-8859-1 for HTTP 1.1
         $this->xml_encoding = 'ISO-8859-1';
     }
     $this->debug('Use encoding: ' . $this->xml_encoding . ' when creating nusoap_parser');
     // parse response, get soap parser obj
     $parser = new nusoap_parser($data, $this->xml_encoding, '', $this->decode_utf8);
     // parser debug
     $this->debug("parser debug: \n" . $parser->getDebug());
     // if fault occurred during message parsing
     if ($err = $parser->getError()) {
         $this->result = 'fault: error in msg parsing: ' . $err;
         $this->fault('SOAP-ENV:Client', "error in msg parsing:\n" . $err);
         // else successfully parsed request into soapval object
     } else {
         // get/set methodname
         $this->methodURI = $parser->root_struct_namespace;
         $this->methodname = $parser->root_struct_name;
         $this->debug('methodname: ' . $this->methodname . ' methodURI: ' . $this->methodURI);
         $this->debug('calling parser->get_soapbody()');
         $this->methodparams = $parser->get_soapbody();
         // get SOAP headers
         $this->requestHeaders = $parser->getHeaders();
         // get SOAP Header
         $this->requestHeader = $parser->get_soapheader();
         // add document for doclit support
         $this->document = $parser->document;
     }
 }
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:52,代码来源:nusoap.php


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