title: Parse a multipart SOAP response in Swift
body: <p>I'm trying to download a file from a soap service and I'm getting the following after a successful request</p>
  
  <p>the response header</p>
  
  <pre><code>multipart/related; type="application/xop+xml"; boundary="uuid:917b60a9-3089-43ad-a8c2-b4a3c62db98c"; start="&lt;root.message@cxf.apache.org&gt;"; start-info="text/xml"
  </code></pre>
  
  <p>response body </p>
  
  <pre><code>--uuid:0a679f64-0753-44fe-b627-2267b5b72b1d
  Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
  Content-Transfer-Encoding: binary
  Content-ID: &lt;root.message@cxf.apache.org&gt;
  
  &lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;soap:Body&gt;&lt;ns2:leseDokumentResponse xmlns:ns2="http://webservice/"&gt;&lt;return&gt;&lt;status&gt;OK&lt;/status&gt;&lt;dokument&gt;&lt;xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:c58d3315-9cb6-413a-98a1-5a29671cfdb6-41@cxf.apache.org"/&gt;&lt;/dokument&gt;&lt;/return&gt;&lt;/ns2:leseDokumentResponse&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;
  --uuid:0a679f64-0753-44fe-b627-2267b5b72b1d
  Content-Type: application/octet-stream
  Content-Transfer-Encoding: binary
  Content-ID: &lt;c58d3315-9cb6-413a-98a1-5a29671cfdb6-41@cxf.apache.org&gt;
  
  ... binary data ...
  --uuid:0a679f64-0753-44fe-b627-2267b5b72b1d--
  </code></pre>
  
  <p>How can I parse the file binary data?</p>
  
  <p>I tried these questions but nothing works <a href="https://stackoverflow.com/q/18643018/6689101">Parsing http-multipart response</a> <a href="https://stackoverflow.com/q/22095186/6689101">Parse multipart response for image download in ios</a></p>