本文整理汇总了PHP中nusoap_client::getHTTPBody方法的典型用法代码示例。如果您正苦于以下问题:PHP nusoap_client::getHTTPBody方法的具体用法?PHP nusoap_client::getHTTPBody怎么用?PHP nusoap_client::getHTTPBody使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nusoap_client
的用法示例。
在下文中一共展示了nusoap_client::getHTTPBody方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getHTTPBody
/**
* gets the HTTP body for the current request.
*
* @param string $soapmsg The SOAP payload
* @return string The HTTP body, which includes the SOAP payload
* @access private
*/
function getHTTPBody($soapmsg)
{
if (count($this->requestAttachments) > 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->requestAttachments 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);
}