title: JAX-WS client handle SOAPFaultException
body: <p>A web service I'm connecting to throws a <code>SOAPFaultException</code> for all its exceptions which means the app throws only <code>RuntimeExceptions</code>.</p>
  
  <p>Using wsimport I generated the code and objects to connect and communicate with the service, it also generated the JAXB objects which represents the xml content in the <code>detail</code> element of the <code>SOAPFaultException</code>.</p>
  
  <pre><code>   &lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
     &lt;soap:Body&gt;
        &lt;soap:Fault&gt;
           &lt;faultcode&gt;soap:Server&lt;/faultcode&gt;
           &lt;faultstring&gt;Soap Exception From Server&lt;/faultstring&gt;
           &lt;faultactor&gt;url&lt;/faultactor&gt;
           &lt;detail&gt;
              &lt;MyResponse&gt;
                 &lt;myID&gt;123&lt;/myId&gt;
                 &lt;serverName&gt;Test&lt;/serverName&gt;
                 &lt;error&gt;
                    &lt;desc&gt;Unable to verify id&lt;/desc&gt;
                 &lt;/error&gt;
              &lt;/MyResponse&gt;
           &lt;/detail&gt;
        &lt;/soap:Fault&gt;
     &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>Wsimport generated a jaxb object called <code>MyResponse</code> with <code>myId</code>,<code>serverName</code>, <code>error</code>,<code>desc</code> as variables</p>
  
  <p>I want to know how can I populate the <code>MyResponse</code> jaxb object that was generated, with the <code>detail</code> element data or do I have to navigate through the elements by node to get the values?</p>