Hi, You can save the message whatever you want to the cxf Message/Exchange, and then add another interceptor for the OutFaultChain(at the very beginning), where you can get the exception by means like message.getContent(Exception.class) You can modify this exception and set any cause text you saved before ------------- Freeman Fang
Red Hat, Inc. FuseSource is now part of Red Hat Web: http://fusesource.com | http://www.redhat.com/ Twitter: freemanfang Blog: http://freemanfang.blogspot.com http://blog.sina.com.cn/u/1473905042 weibo: http://weibo.com/u/1473905042 On 2012-10-11, at 上午4:45, rouble wrote: > 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
