title: Deserialization with Axis 2
body: <p>I have some Java code that takes an XML (SOAP) message and returns the deserialized object:</p>
  
  <pre><code>public static &lt;T&gt; T deserializeObject(String xml, Class&lt;T&gt; clazz) throws AxisFault, Exception {
      assert xml != null : "xml != null";
      assert clazz != null : "clazz != null";
  
      T result = null;
      try {
          Message message = new Message(SOAP_START + xml + SOAP_END);
          result = (T)message.getSOAPEnvelope().getFirstBody().getObjectValue(clazz);
      } catch (Exception e) {
          // most likely namespace error due to removed namespaces
          Message message = new Message(SOAP_START_XSI + xml + SOAP_END);
          result = (T)message.getSOAPEnvelope().getFirstBody().getObjectValue(clazz);
      }
         return result;
      }
  </code></pre>
  
  <p>However this code only works with Axis 1.4 :-(  Could someone Help me have that code work with Axis 2?</p>
  
  <p>In fact, I might just need to know what to replace the <code>import org.apache.axis.Message</code> with?
  Thanks in advance.</p>