How to unmarshal SoapFault from raw xml payload from a file?
<p>Suppose I have following xml payload in a file</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;ns2:Fault 
   xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/"   
   xmlns:ns3="http://www.w3.org/2003/05/soap-envelope"&gt;
  &lt;faultcode&gt;ns2:Server&lt;/faultcode&gt;
  &lt;faultstring&gt;some Error&lt;/faultstring&gt;
  &lt;detail&gt;
    &lt;ns4:ApplicationSOAPFault xmlns:ns4="http://application.exception"&gt;
      &lt;code&gt;04&lt;/code&gt;
      &lt;message&gt;SimiError&lt;/message&gt;
    &lt;/ns4:ApplicationSOAPFault&gt;
  &lt;/detail&gt;
&lt;/ns2:Fault&gt;
</code></pre>

<p>How to unmarshall this into a SoapFault (and CheckedException if available) and throw it as exception?</p>

<p><strong>Background</strong> </p>

<p>We are trying to build a simulator that during record/proxy mode dumps the WebService Request and Response payload xml to FileSystem using LogicalHandler.(i.e  After making webservice call to target server and get valid response back) </p>

<p>In case target server returns Soap Fault, SoapFault like above is dumped to File System.</p>

<p>When simulator is switched to playback mode Matching Response unmarshalled from the dump is server back (done with JAXB.unmarshall())</p>

<p>This works fine however simulator is currently not able to unmarshall SoapFault ( and corresponding CheckedException ) and throw it as Exception.</p>