本文整理汇总了PHP中soapclient::parseResponse方法的典型用法代码示例。如果您正苦于以下问题:PHP soapclient::parseResponse方法的具体用法?PHP soapclient::parseResponse怎么用?PHP soapclient::parseResponse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类soapclient
的用法示例。
在下文中一共展示了soapclient::parseResponse方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseResponse
/**
* processes SOAP message returned from server
*
* @param array $headers The HTTP headers
* @param string $data unprocessed response data from server
* @return mixed value of the message, decoded into a PHP type
* @access protected
*/
function parseResponse($headers, $data)
{
$this->debug('Entering parseResponse() for payload of length ' . strlen($data) . ' and type of ' . $headers['content-type']);
$this->responseAttachments = array();
if (strstr($headers['content-type'], 'multipart/related')) {
$this->debug('Decode multipart/related');
$input = '';
foreach ($headers as $k => $v) {
$input .= "{$k}: {$v}\r\n";
}
$params['input'] = $input . "\r\n" . $data;
$params['include_bodies'] = true;
$params['decode_bodies'] = true;
$params['decode_headers'] = true;
$structure = Mail_mimeDecode::decode($params);
foreach ($structure->parts as $part) {
if (!isset($part->disposition)) {
$this->debug('Have root part of type ' . $part->headers['content-type']);
$return = parent::parseResponse($part->headers, $part->body);
} else {
$this->debug('Have an attachment of type ' . $part->headers['content-type']);
$info['data'] = $part->body;
$info['filename'] = isset($part->d_parameters['filename']) ? $part->d_parameters['filename'] : '';
$info['contenttype'] = $part->headers['content-type'];
$info['cid'] = $part->headers['content-id'];
$this->responseAttachments[] = $info;
}
}
if (isset($return)) {
return $return;
}
$this->setError('No root part found in multipart/related content');
return;
}
$this->debug('Not multipart/related');
return parent::parseResponse($headers, $data);
}