cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rouble <r.ou...@gmail.com>
Subject Getting aferUnmarshall to throw a meaningful exception
Date Wed, 10 Oct 2012 20:45:33 GMT
CXF Gurus,

We were looking into using the afterUnmarshal(Unmarshaller, Object
parent) method to validate data beans. This works well, except we
can't seem to send back a meaningful exception. We tried throwing a
new UnmarshallException("Some text", "Some other text") but it does
not matter what we throw inside afterUnmarshall it always looks like
this on the client:
   <soap:Fault>
     <faultcode>soap:Client</faultcode>
     <faultstring>Unmarshalling Error: null </faultstring>
   </soap:Fault>

Is it possible to throw a meaningful exception that will get properly
unmarshalled into XML/text to the client? We want to be able to tell
the client something like: "Field ABC is mandatory".

Note here that we tried to enable schema validation to do this
validation for us but that has some drawbacks which I won't get into
for now.

tia,
rouble

Mime
View raw message