/** * {@inheritDoc} */ public function convertPhpToXml($data) { $part = new MimePart($data); $contentId = trim($part->getHeader('Content-ID'), '<>'); $this->soapKernel->addAttachment($part); return sprintf('<%s href="%s"/>', $this->getTypeName(), 'cid:' . $contentId); }
/** * {@inheritDoc} */ public function convertPhpToXml($data) { $part = new MimePart($data); $contentId = trim($part->getHeader('Content-ID'), '<>'); $this->soapKernel->addAttachment($part); $doc = new \DOMDocument(); $node = $doc->createElement($this->getTypeName()); $doc->appendChild($node); // add xop:Include element $xinclude = $doc->createElementNS(Helper::NS_XOP, Helper::PFX_XOP . ':Include'); $xinclude->setAttribute('href', 'cid:' . $contentId); $node->appendChild($xinclude); return $doc->saveXML(); }