On Monday, September 12, 2011 8:31:29 AM [email protected] 
wrote:
> Hi,
> 
> I am receiving the following answer from a foreign Web service:
> <?xml version="1.0" encoding="UTF-8"?>
> <SOAP-ENV:Envelope
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";> <SOAP-ENV:Body>
>         <SOAP-ENV:Fault>
>             <faultcode xmlns="">SOAP-ENV:Server</faultcode>
>             <faultstring xmlns="">This is an operation implementation
> generated fault</faultstring> <faultactor xmlns="" />
>             <detail xmlns="">
>                 <rv:fault xmlns:xs="http://www.w3.org/2001/XMLSchema";
>                        
> xmlns:rv="http://com/company/Service/RuleVerification";
> xmlns:fwk="http://com/company/Service/Framework/XSD/GenericException/200";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:type="fwk:BusinessException">
>                     <fwk:errors>
>                         <fwk:code>F00006</fwk:code>
>                         <fwk:dataInError>NREPVEH</fwk:dataInError>
>                     </fwk:errors>
>                 </rv:fault>
>             </detail>
>         </SOAP-ENV:Fault>
>     </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
> 
> I have generated some JAXB bindings through CXF codegen WSDL to Java and I'm
> expecting that the fault detail would be unmarshalled in something like
> com.company.service.framework.exception.BusinessException. It is not the
> case, because xsi:type is not honorred.
> 
> Looking at the code of org.apache.cxf.interceptor.ClientFaultConverter,
> method processFaultDetail(...), I indeed see that xsi:type is not taken
> into account. Is it a normal feature, conforming to the specs, or does it
> deserve a bug report for a enhancement?

Well, I don't think it needs to be taken into account there for the generated 
code.   It calls into the databinding "read" method which SHOULD be taking the 
xsi:type into account (aka: JAXB should be unmarshalling to the appropriate 
subclass) and then the constructor of    (String,Superclass) is found and 
called.

I guess I'd really need to see a full testcase to see if there is really a bug 
here or not.

-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com

Reply via email to