You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Jarek Kucypera <jk...@mikrozet.wroc.pl> on 2007/04/16 23:40:54 UTC

[Axis2 1.1.1] Exceptions and POJO services

If I declare a (non-void) service method to throw an exception,
the resulting wsdl describes the corresponding exception
type as anyType, like this:
     <xs:complexType>
      <xs:sequence>
       <xs:element name="getWalletFault" type="xs:anyType" />
      </xs:sequence>
     </xs:complexType>
Is there a way to throw custom exceptions (return faults of custom
types) from POJO based services, so that the fault type is
described in the wsdl ?

J.K.

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


Re: [Axis2 1.1.1] Exceptions and POJO services

Posted by "John G. Norman" <jo...@7fff.com>.
I'm having the same problem. In my POJO service I have something like:

public String myOp(String s) throws MyException . . .

But no fault for MyException is showing up in the WSDL, and so when I
try to generate an ADB client against the WSDL, I don't get
client-side exception code generated. And if I throw MyException from
the service, all I get is RemoteException on the client (with cause
set to null).

Could someone from Axis2 verify this a bit? POJO service/client
handling of exceptions seems pretty broken. I could file a JIRA, but
I'm uncertain that a description of these symptoms would capture what
seems to be pretty significant lack of functionality. (Or maybe POJO
services aren't supposed to throw exceptions!?)

On 4/16/07, Jarek Kucypera <jk...@mikrozet.wroc.pl> wrote:
> If I declare a (non-void) service method to throw an exception,
> the resulting wsdl describes the corresponding exception
> type as anyType, like this:
>      <xs:complexType>
>       <xs:sequence>
>        <xs:element name="getWalletFault" type="xs:anyType" />
>       </xs:sequence>
>      </xs:complexType>
> Is there a way to throw custom exceptions (return faults of custom
> types) from POJO based services, so that the fault type is
> described in the wsdl ?
>
> J.K.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

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