shx
shx

Reputation: 1138

CXF - exception handling and response with my custom message

I have developed web service using Apache CXF and now I want to deal with exception handling mechanism. Is there any way to configure it like some general listener (aspect, interceptor, whatever...) waiting for any runtime exception. and when it occurs will send my custom ResponseType message to user. This custom message is, it's clear, type from XSD scheme.

Upvotes: 0

Views: 297

Answers (1)

Saravana Kumar
Saravana Kumar

Reputation: 113

It is good to define fault for each operation you expose. Avoid throwing run time exception instead handle it in service itself.

Upvotes: 1

Related Questions