How to parse/download file and XML from SOAP with bare Java
<p>I'm slated to handle a "file download" using SOAP/XML via some barebones Java.
I already have XML parsing going nicely using the "java.net.HttpURLConnection" package.</p>

<p>Using the same tools I can successfully 'pull' a multipart "message" that contains XML and the desired file.
Sadly, my attempts to parse this into a working file have failed.</p>

<p>I'm restricted by my codebase, I'm on Java 6, I don't have Maven nor any other such manager, and I'm using an aged IDE (Domino Designer Release 9.0.1).</p>

<p>Clarification edit:
I am using "java.net.HttpURLConnection" to pull the data, and I have a simple XML parser.
The act of converting the "response" into text seems to break the file-portion of the data.
I'm seeing a ton of help on the web for pushing a mime/mtom via SOAP/http/etc but none for pulling and successfully saving both the xml and the file.
(I've tried this using SOAPUI and it's "save attachment" functionality successfully, pulling the file in working order)</p>

<p>Example file I'm trying to handle:</p>

<pre><code>--uuid:a6843a74-8d18-4c91-aae0-229258b6ecd2+id=23
Content-ID: &lt;http://tempuri.org/0&gt;
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="application/soap+xml"

&lt;s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"&gt;
&lt;s:Header&gt;
    &lt;a:Action s:mustUnderstand="1"&gt;ANOND/ServiceContracts/AttachmentManagement/GetCaseFileResponse&lt;/a:Action&gt;
&lt;/s:Header&gt;
&lt;s:Body&gt;
    &lt;GetCaseFileResponse xmlns="ANOND/MessageContracts/"&gt;
        &lt;CaseFile xmlns="ANOND/MessageContracts/GetCaseFileResponse" xmlns:b="ANOND/DataContracts/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt;
            &lt;b:CaseId&gt;999&lt;/b:CaseId&gt;
            &lt;b:Content&gt;
                &lt;xop:Include href="cid:http://tempuri.org/1/635888027517869513" xmlns:xop="http://www.w3.org/2004/08/xop/include"/&gt;
            &lt;/b:Content&gt;
            &lt;b:Description&gt;Single sentence of data.&lt;/b:Description&gt;
            &lt;b:FileCategoryId&gt;1&lt;/b:FileCategoryId&gt;
            &lt;b:FileType&gt;image/jpeg&lt;/b:FileType&gt;
            &lt;b:Filename&gt;photo 5.JPG&lt;/b:Filename&gt;    &lt;b:URL/&gt;
            &lt;b:CaseFileId&gt;9999&lt;/b:CaseFileId&gt;
            &lt;b:DateUploaded&gt;2015-10-05T12:34:35.97&lt;/b:DateUploaded&gt;
        &lt;/CaseFile&gt;
        &lt;ValidationResults xmlns="ANOND/MessageContracts/ServiceResponse" xmlns:b="ANOND/DataContracts/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/&gt;
    &lt;/GetCaseFileResponse&gt;
&lt;/s:Body&gt;
&lt;/s:Envelope&gt;



--uuid:a6843a74-8d18-4c91-aae0-229258b6ecd2+id=23
Content-ID: &lt;http://tempuri.org/1/635888027517869513&gt;
Content-Transfer-Encoding: binary
Content-Type: application/octet-stream

????2ExifMASSOFBINARYHERE
--uuid:a6843a74-8d18-4c91-aae0-229258b6ecd2+id=23--
</code></pre>