You should be able to write an interceptor that lives on the clients FaultIn chain that would live immediately after the ClientFaultConverter interceptor in the Phase.UNMARSHAL phase. (actually, any phase after that would also work). It would do:
Exception e = msg.getContent(Exception.class); and then remap to anything you want. Create a new exception instance and call msg.setContent(Exception.class, e); Dan On Tuesday 23 November 2010 5:32:28 pm Alex wrote: > Hi, > > I develop a consumer for an third party webservice, which send in case > of an error: > > <SOAP-ENV:Envelope > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> > <SOAP-ENV:Header/> > <SOAP-ENV:Body> > <SOAP-ENV:Fault> > <faultcode>SOAP-ENV:Server</faultcode> > <faultstring > > xml:lang="en-US">cs.webservice.it.col.error.ValidationFailedException</faul > tstring> <detail> > <KeyCallFault xmlns="ns://col.it.webservice.cs/KeyCall/V1"> > <code xmlns="">DT-0005</code> > <message xmlns="">request validation failed, missing tag keysize</message> > </KeyCallFault> > </detail> > </SOAP-ENV:Fault> > </SOAP-ENV:Body> > </SOAP-ENV:Envelope> > > I can catch this with javax.xml.ws.soap.SOAPFaultException. > > This behaviour is NOT defined in the WSDL (like <wsdl:fault > name="..."><soap:fault name="..." use="literal"/></wsdl:fault>), so > wsdl2java doesn't create a > an exception class, only the class for the complex type KeyCallFault > from the schema file. > > How can I map the SOAPFaultException to type KeyCallFault. > > Alex -- Daniel Kulp [email protected] http://dankulp.com/blog
