axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Ribeaud <christian.ribe...@finebrain.com>
Subject XML stream to java Object
Date Sat, 26 May 2007 11:35:16 GMT
Hi,

If my XML stream response looks as following:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soap:Body>
    <soap:Fault>
      <faultcode>soap:Server</faultcode>
      <faultstring>Invalid application client.</faultstring>
      <detail>
        <InvalidAuthenticationException xmlns="urn:SecurityServer">
          <cause xmlns:ns1="http://www.w3.org/2001/XMLSchema-instance"
ns1:nil="true"
            xmlns="http://exception.com" />
          <messages xmlns="http://exception.com">
            <string>Invalid application client.</string>
          </messages>
          <throwableCount xmlns="http://exception.com">1</throwableCount>
          <throwables xmlns="http://exception.com">
            <ns1:Throwable xmlns:ns1="http://lang.java" />
          </throwables>
        </InvalidAuthenticationException>
      </detail>
    </soap:Fault>
  </soap:Body>
</soap:Envelope>

How can I convert it into a java Object with Axis2? Doing it as following is
the correct way or am I completely wrong?

XMLStreamReader reader
XMLInputFactory.newInstance().createXMLStreamReader(new
StringReader(response));
OMElement element = new StAXOMBuilder(reader).getDocumentElement();

BeanUtil.deserialize(element, new Object[] {Fault.class}, new
DefaultObjectSupplier());

Any help would be gratefully appreciated. Thanks a lot and have a nice day.
Cheers,

christian



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message