Lines Matching +full:v +full:- +full:home

3 $Id: nusoapmime.php,v 1.12 2007/04/17 16:34:03 snichol Exp $
5 NuSOAP - Web Services Toolkit for PHP
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 The NuSOAP project home is:
27 nusoap-general@lists.sourceforge.net
47 * http://www.w3.org/TR/SOAP-attachments. It depends on the PEAR Mail_MIME library.
51 * @version $Id: nusoapmime.php,v 1.12 2007/04/17 16:34:03 snichol Exp $
83 …* @param string $contenttype The MIME Content-Type of the attachment (default is application/octet
84 * @param string $cid The content-id (cid) of the attachment (default is false)
85 * @return string The content-id (cid) of the attachment
88 …function addAttachment($data, $filename = '', $contenttype = 'application/octet-stream', $cid = fa…
98 $this->requestAttachments[] = $info;
109 $this->requestAttachments = array();
123 return $this->responseAttachments;
134 if (count($this->requestAttachments) > 0) {
141 $params['charset'] = $this->soap_defencoding;
142 $mimeMessage->addSubpart($soapmsg, $params);
144 foreach ($this->requestAttachments as $att) {
160 $mimeMessage->addSubpart($data, $params);
162 $mimeMessage->addSubpart($att['data'], $params);
166 $output = $mimeMessage->encode();
169 foreach ($mimeHeaders as $k => $v) {
170 $this->debug("MIME header $k: $v");
171 if (strtolower($k) == 'content-type') {
174 $this->mimeContentType = str_replace("\r\n", " ", $v);
193 if (count($this->requestAttachments) > 0) {
194 return $this->mimeContentType;
201 * returns false for non-text content types.
209 if (count($this->requestAttachments) > 0) {
224 …$this->debug('Entering parseResponse() for payload of length ' . strlen($data) . ' and type of ' .…
225 $this->responseAttachments = array();
226 if (strstr($headers['content-type'], 'multipart/related')) {
227 $this->debug('Decode multipart/related');
229 foreach ($headers as $k => $v) {
230 $input .= "$k: $v\r\n";
239 foreach ($structure->parts as $part) {
240 if (!isset($part->disposition) && (strstr($part->headers['content-type'], 'text/xml'))) {
241 $this->debug('Have root part of type ' . $part->headers['content-type']);
242 $root = $part->body;
243 $return = parent::parseResponse($part->headers, $part->body);
245 $this->debug('Have an attachment of type ' . $part->headers['content-type']);
246 $info['data'] = $part->body;
247 … $info['filename'] = isset($part->d_parameters['filename']) ? $part->d_parameters['filename'] : '';
248 $info['contenttype'] = $part->headers['content-type'];
249 $info['cid'] = $part->headers['content-id'];
250 $this->responseAttachments[] = $info;
255 $this->responseData = $root;
259 $this->setError('No root part found in multipart/related content');
262 $this->debug('Not multipart/related');
277 * http://www.w3.org/TR/SOAP-attachments. It depends on the PEAR Mail_MIME library.
281 * @version $Id: nusoapmime.php,v 1.12 2007/04/17 16:34:03 snichol Exp $
308 $this->encoding = $enc;
322 …* @param string $contenttype The MIME Content-Type of the attachment (default is application/octet
323 * @param string $cid The content-id (cid) of the attachment (default is false)
324 * @return string The content-id (cid) of the attachment
327 …function addAttachment($data, $filename = '', $contenttype = 'application/octet-stream', $cid = fa…
337 $this->responseAttachments[] = $info;
348 $this->responseAttachments = array();
362 return $this->requestAttachments;
373 if (count($this->responseAttachments) > 0) {
380 $params['encoding'] = $this->encoding; // BSP
381 $params['charset'] = $this->soap_defencoding;
382 $mimeMessage->addSubpart($soapmsg, $params);
384 foreach ($this->responseAttachments as $att) {
389 $params['encoding'] = $this->encoding; // BSP
401 $mimeMessage->addSubpart($data, $params);
403 $mimeMessage->addSubpart($att['data'], $params);
407 $output = $mimeMessage->encode();
410 foreach ($mimeHeaders as $k => $v) {
411 $this->debug("MIME header $k: $v");
412 if (strtolower($k) == 'content-type') {
415 $this->mimeContentType = str_replace("\r\n", " ", $v);
434 if (count($this->responseAttachments) > 0) {
435 return $this->mimeContentType;
442 * returns false for non-text content types.
450 if (count($this->responseAttachments) > 0) {
465 …$this->debug('Entering parseRequest() for payload of length ' . strlen($data) . ' and type of ' . …
466 $this->requestAttachments = array();
467 if (strstr($headers['content-type'], 'multipart/related')) {
468 $this->debug('Decode multipart/related');
470 foreach ($headers as $k => $v) {
471 $input .= "$k: $v\r\n";
480 foreach ($structure->parts as $part) {
481 if (!isset($part->disposition) && (strstr($part->headers['content-type'], 'text/xml'))) {
482 $this->debug('Have root part of type ' . $part->headers['content-type']);
483 $return = parent::parseRequest($part->headers, $part->body);
485 $this->debug('Have an attachment of type ' . $part->headers['content-type']);
486 $info['data'] = $part->body;
487 … $info['filename'] = isset($part->d_parameters['filename']) ? $part->d_parameters['filename'] : '';
488 $info['contenttype'] = $part->headers['content-type'];
489 $info['cid'] = $part->headers['content-id'];
490 $this->requestAttachments[] = $info;
498 $this->setError('No root part found in multipart/related content');
501 $this->debug('Not multipart/related');