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


PHP soap_server::getHTTPBody方法代码示例

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


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

示例1: getHTTPBody

 /**
  * gets the HTTP body for the current response.
  *
  * @param string $soapmsg The SOAP payload
  * @return string The HTTP body, which includes the SOAP payload
  * @access private
  */
 function getHTTPBody($soapmsg)
 {
     if (count($this->responseAttachments) > 0) {
         $params['content_type'] = 'multipart/related; type=text/xml';
         $mimeMessage =& new Mail_mimePart('', $params);
         unset($params);
         $params['content_type'] = 'text/xml';
         $params['encoding'] = '8bit';
         $params['charset'] = $this->soap_defencoding;
         $mimeMessage->addSubpart($soapmsg, $params);
         foreach ($this->responseAttachments as $att) {
             unset($params);
             $params['content_type'] = $att['contenttype'];
             $params['encoding'] = 'base64';
             $params['disposition'] = 'attachment';
             $params['dfilename'] = $att['filename'];
             $params['cid'] = $att['cid'];
             if ($att['data'] == '' && $att['filename'] != '') {
                 if ($fd = fopen($att['filename'], 'rb')) {
                     $data = fread($fd, filesize($att['filename']));
                     fclose($fd);
                 } else {
                     $data = '';
                 }
                 $mimeMessage->addSubpart($data, $params);
             } else {
                 $mimeMessage->addSubpart($att['data'], $params);
             }
         }
         $output = $mimeMessage->encode();
         $mimeHeaders = $output['headers'];
         foreach ($mimeHeaders as $k => $v) {
             $this->debug("MIME header {$k}: {$v}");
             if (strtolower($k) == 'content-type') {
                 // PHP header() seems to strip leading whitespace starting
                 // the second line, so force everything to one line
                 $this->mimeContentType = str_replace("\r\n", " ", $v);
             }
         }
         return $output['body'];
     }
     return parent::getHTTPBody($soapmsg);
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:50,代码来源:nusoapmime.php


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