protected function initializeMtomSoapMessage(array $contentTypeHeader, $content)
 {
     if (!isset($contentTypeHeader['start']) || !isset($contentTypeHeader['start-info']) || !isset($contentTypeHeader['boundary'])) {
         throw new \InvalidArgumentException();
     }
     $mimeMessage = Message::createFromMessage($content, $contentTypeHeader['boundary']);
     $mimeParts = $mimeMessage->getParts();
     $soapMimePartId = trim($contentTypeHeader['start'], '<>');
     $soapMimePartType = $contentTypeHeader['start-info'];
     $rootPart = array_shift($mimeParts);
     $rootPartType = $this->splitContentTypeHeader($rootPart->type);
     // TODO: add more checks to achieve full compatibility to MTOM spec
     // http://www.w3.org/TR/soap12-mtom/
     if ($rootPart->id != $soapMimePartId || $rootPartType['_type'] != 'application/xop+xml' || $rootPartType['type'] != $soapMimePartType) {
         throw new \InvalidArgumentException();
     }
     foreach ($mimeParts as $mimePart) {
         $this->soapAttachments->add(new SoapAttachment($mimePart->id, $mimePart->type, $mimePart->getContent()));
     }
     // handle content decoding / prevent encoding
     return $rootPart->getContent();
 }
 /**
  * @param array $headers
  */
 public function setHeaders($headers)
 {
     $this->headers = new Collection('getName');
     $this->headers->addAll($headers);
 }