You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by tutu <tu...@gmail.com> on 2009/06/23 11:44:34 UTC
How to handle exceptions in server side?
Hi all,
I'm a newbe to apache cxf. I use it with spring. I've just written few web
services and now I want to handle exceptions with them.
For example, i have a web service named CreateUserService that create a user
in database. I want this service to return exceptions if pb during user
creation like:
100: admin athentication failed
200: invalid parameter
500: application error / database not reachable
I've read few articles and searched for any solution in this forum but i do
not found anything (may be i'm not a good searcher...).
Does anybody has an idea or any solutions please?
thanks,
tugdual
--
View this message in context: http://www.nabble.com/How-to-handle-exceptions-in-server-side--tp24162891p24162891.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: How to handle exceptions in server side?
Posted by tutu <tu...@gmail.com>.
Thanks for this example Glen,
I think that will be very helpfull for me. That's what I want to do!
Tugdual
Glen Mazza wrote:
>
> I'm not an expert at this but this is what I was able to manage with
> wsdl:faults:
> http://www.jroller.com/gmazza/entry/database_crud_actions_with_web
>
> HTH,
> Glen
>
>
> tutu wrote:
>>
>> Hi all,
>>
>> I'm a newbe to apache cxf. I use it with spring. I've just written few
>> web services and now I want to handle exceptions with them.
>> For example, i have a web service named CreateUserService that create a
>> user in database. I want this service to return exceptions if pb during
>> user creation like:
>> 100: admin athentication failed
>> 200: invalid parameter
>> 500: application error / database not reachable
>>
>> I've read few articles and searched for any solution in this forum but i
>> do not found anything (may be i'm not a good searcher...).
>>
>> Does anybody has an idea or any solutions please?
>>
>> thanks,
>>
>> tugdual
>>
>
>
--
View this message in context: http://www.nabble.com/How-to-handle-exceptions-in-server-side--tp24162891p24198852.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: How to handle exceptions in server side?
Posted by Glen Mazza <gl...@gmail.com>.
IIRC, no. I don't think JAX-WS allows hierarchies/subclassing for SOAP fault
classes.
Glen
tutu wrote:
>
> Just a question about your example:
> Do these classes implements or extends any class?
>
> org.example.employee.BasicFault and
> org.example.employee.DataProcessingFault
>
> thanks,
>
> tugdual
>
>
>
> Glen Mazza wrote:
>>
>> I'm not an expert at this but this is what I was able to manage with
>> wsdl:faults:
>> http://www.jroller.com/gmazza/entry/database_crud_actions_with_web
>>
>> HTH,
>> Glen
>>
>>
>> tutu wrote:
>>>
>>> Hi all,
>>>
>>> I'm a newbe to apache cxf. I use it with spring. I've just written few
>>> web services and now I want to handle exceptions with them.
>>> For example, i have a web service named CreateUserService that create a
>>> user in database. I want this service to return exceptions if pb during
>>> user creation like:
>>> 100: admin athentication failed
>>> 200: invalid parameter
>>> 500: application error / database not reachable
>>>
>>> I've read few articles and searched for any solution in this forum but i
>>> do not found anything (may be i'm not a good searcher...).
>>>
>>> Does anybody has an idea or any solutions please?
>>>
>>> thanks,
>>>
>>> tugdual
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/How-to-handle-exceptions-in-server-side--tp24162891p24210138.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: How to handle exceptions in server side?
Posted by tutu <tu...@gmail.com>.
Just a question about your example:
Do these classes implements or extends any class?
org.example.employee.BasicFault and org.example.employee.DataProcessingFault
thanks,
tugdual
Glen Mazza wrote:
>
> I'm not an expert at this but this is what I was able to manage with
> wsdl:faults:
> http://www.jroller.com/gmazza/entry/database_crud_actions_with_web
>
> HTH,
> Glen
>
>
> tutu wrote:
>>
>> Hi all,
>>
>> I'm a newbe to apache cxf. I use it with spring. I've just written few
>> web services and now I want to handle exceptions with them.
>> For example, i have a web service named CreateUserService that create a
>> user in database. I want this service to return exceptions if pb during
>> user creation like:
>> 100: admin athentication failed
>> 200: invalid parameter
>> 500: application error / database not reachable
>>
>> I've read few articles and searched for any solution in this forum but i
>> do not found anything (may be i'm not a good searcher...).
>>
>> Does anybody has an idea or any solutions please?
>>
>> thanks,
>>
>> tugdual
>>
>
>
--
View this message in context: http://www.nabble.com/How-to-handle-exceptions-in-server-side--tp24162891p24203713.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: How to handle exceptions in server side?
Posted by Glen Mazza <gl...@gmail.com>.
I'm not an expert at this but this is what I was able to manage with
wsdl:faults:
http://www.jroller.com/gmazza/entry/database_crud_actions_with_web
HTH,
Glen
tutu wrote:
>
> Hi all,
>
> I'm a newbe to apache cxf. I use it with spring. I've just written few web
> services and now I want to handle exceptions with them.
> For example, i have a web service named CreateUserService that create a
> user in database. I want this service to return exceptions if pb during
> user creation like:
> 100: admin athentication failed
> 200: invalid parameter
> 500: application error / database not reachable
>
> I've read few articles and searched for any solution in this forum but i
> do not found anything (may be i'm not a good searcher...).
>
> Does anybody has an idea or any solutions please?
>
> thanks,
>
> tugdual
>
--
View this message in context: http://www.nabble.com/How-to-handle-exceptions-in-server-side--tp24162891p24188148.html
Sent from the cxf-user mailing list archive at Nabble.com.