axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <alexander.bec...@eiskonzept.com>
Subject AW: Exception Handling - possible solution
Date Mon, 05 Apr 2004 22:15:29 GMT
Hello,

when I invoking the "getQuote" method, I am getting following xml stream:
  <?xml version="1.0" encoding="UTF-8"?>
  <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
    <soapenv:Fault>
     <faultcode>soapenv:Server.generalException</faultcode>
     <faultstring></faultstring>
     <detail>
      <ns1:exceptionName
xmlns:ns1="http://xml.apache.org/axis/">com.test.InvalidTickerFaultMessage</n
s1:exceptionName>
     </detail>
    </soapenv:Fault>
   </soapenv:Body>
  </soapenv:Envelope>

Axis (1.2 alpha) deserialize this stream to
"com.test.InvalidTickerFaultMessage" class, but the InvalidTickerFaultMessage
attribute "tickerSymbol" is missing in this xml stream. Additionally the
generated "com.test.InvalidTickerFaultMessage" class extends
"org.apache.axis.AxisFault" - it is not correct. JAX-RPC saith that
exceptions must extends "java.rmi.RemoteException" and the webservice classes
(actions) must not know that they are used by Axis (or SOAP2.3 or ...). And
when the InvalidTickerFaultMessage class extends "java.rmi.RemoteException",
Following xml stream will generated:
  <?xml version="1.0" encoding="UTF-8"?>
  <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
    <soapenv:Fault>
     <faultcode>soapenv:Server.userException</faultcode>
     <faultstring>com.test.InvalidTickerFaultMessage</faultstring>
     <detail/>
    </soapenv:Fault>
   </soapenv:Body>
  </soapenv:Envelope>

???

Many thanks for help and your time
Alexander Becker.



-----Ursprüngliche Nachricht-----
Von: Tom Jordahl [mailto:tomj@macromedia.com] 
Gesendet: Freitag, 2. April 2004 00:10
An: 'axis-dev@ws.apache.org'
Betreff: RE: Exception Handling - possible solution



You are enhancing the Axis specific Hack that send the class name of the
exception over the wire.  I invented this (and it was bad) a long time ago.


Axis now uses the <details> element in the fault to locate the correct
Exception class.  A table of QNames to Exception class names is kept and each
child element of <details> is looked up in this table until we find a match
(or don't, then we throw an AxisFault).

This functions correctly, see java/test/wsdl/faults for some test cases that
work.
 
--
Tom Jordahl
Macromedia Server Development

-----Original Message-----
From: alexander.becker@eiskonzept.com
[mailto:alexander.becker@eiskonzept.com] 
Sent: Thursday, April 01, 2004 3:24 PM
To: axis-dev@ws.apache.org
Subject: AW: Exception Handling - possible solution

Hello,

I looked through the sourcecode of Axis 1.1. By a few small changes can xml
stream deserialized correctly. In the attachment of this email lie 3 classes,
which I changed. The changes, which I made are commented und can be found by
searching for "007". Can someone look through the changes and say whether it
ok is or perhaps You be able to use the changes in the next Version.

Excuse me for my englich.

Many Thanks,
Alexander Becker



-----Ursprüngliche Nachricht-----
Von: Steve Loughran [mailto:steve_l@iseran.com] 
Gesendet: Dienstag, 23. März 2004 11:08
An: axis-dev@ws.apache.org
Betreff: Re: Exception Handling


alexander@eiskonzept.com wrote:
> Hello,
> 
> I have "de.eis.ws.axis.WSException extends RemoteException" class on 
> server side. Via Java2WSDL & WSDL2Java was generated 
> "de.eis.ws.axis.WSException extends AxisFault" for a client side. When 
> the Exception is triggered on the server side, a client receives the 
> following XML stream:
> 
>   <?xml version="1.0" encoding="UTF-8"?>
>   <soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> 
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>    <soapenv:Body>
>     <soapenv:Fault>
>      <faultcode>soapenv:Server.userException</faultcode>
>      <faultstring>de.eis.ws.axis.WSException</faultstring>
>      <detail>
>       <de.eis.ws.axis.WSException xsi:type="ns1:WSException" 
> xmlns:ns1="http://axis.ws.eis.de">
>        <message xsi:type="xsd:string" xsi:nil="true"/>
>       </de.eis.ws.axis.WSException>
>      </detail>
>     </soapenv:Fault>
>    </soapenv:Body>
>   </soapenv:Envelope>
> 
> Axis deserialize this Stream to an AxisFault.
> Is there a way to deserialize this Stream to 
> "de.eis.ws.axis.WSException extends AxisFault" class, which was 
> generated via WSDL2Java?

In theory, Axis should follow the exception marshalling behaviour of 
JAX-RPC. If this is not happening, then we have a bug.

Mime
View raw message