How to modify XML error messages with CXF?

Solution Unverified - Updated -

Issue

  • We have a JAX-WS CXF service which receives the request with security header. If authentication fails, the service sends back a generic message "org.apache.ws.security.WSSecurityException: The security token could not be authenticated or authorized..." which is also included in the SOAP response body. Instead of the generic message, we would like to generate a customized meaningful message so user understands the exception well. How can we do this?

Environment

  • JBoss Enterprise Application Platform (EAP) 6.x
  • JBoss Enterprise Application Platform (EAP) 5.x
  • CXF

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content