cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Opalka <ropa...@redhat.com>
Subject Re: Exceptions inheritance JAXB de/serialization issue
Date Mon, 03 Dec 2012 07:36:03 GMT
Clarification,

   was thinking little bit about it during the weekend.

On 11/30/2012 03:20 PM, Richard Opalka wrote:
> Forgot to mention that this is related to CXF-4600 :(
> 
> Follow up (thinking CXF way and for a while ignoring previous post):
> 
> The sources we're going to talk about are located here:
> 
> http://anonsvn.jboss.org/repos/jbossws/shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/jbws3552
> 
> We have the following exception hierarchy:
> 
> @XmlAccessorType(XmlAccessType.FIELD)      @XmlTransient
> ExtendedAdaptedExceptionCA        ->       AdaptedExceptionCA
>  * code                                    * message
>                                            * description
>                                            * complexObject
> 
> CXF reuses JAXB for schema generation and this is the schema we're getting:
> 
>   <xs:element name="ExtendedAdaptedExceptionCA"
> type="tns:ExtendedAdaptedExceptionCA"/>
>   <xs:complexType name="ExtendedAdaptedExceptionCA">
>     <xs:sequence>
>       <xs:element name="description" nillable="true" type="xs:string"/>
>       <xs:element name="complexObject" nillable="true" type="xs:string"/>
>       <xs:element name="message" nillable="true" type="xs:string"/>
>       <xs:element name="code" nillable="true" type="xs:int"/>
>     </xs:sequence>
>   </xs:complexType>
> 
> and
> 
>   <xs:element name="AdaptedExceptionCA" type="tns:AdaptedExceptionCA"/>
>   <xs:complexType name="AdaptedExceptionCA">
>     <xs:sequence/>
>   </xs:complexType>
> 
> In our humbly opinion because AdaptedExceptionCA is @XmlTransient annotated
> 
> see:
> http://docs.oracle.com/javaee/6/api/javax/xml/bind/annotation/XmlTransient.html
> 
> the above AdaptedExceptionCA definition generated by de facto "JAXB
> STANDARD" is wrong.

Still valid claim that JAXB generates wrong XML schema.

> If we'll ignore (will close all our eyes) the fact that inheritance is
> completely broken (what is completely wrong BTW)

Above claim is wrong. @XmlTransient annotated objects cannot be mapped
to XML schema, so if exceptions inheritance hierarchy is not mapped to
XML, it is correct.

> when mapped to XML then the above definition should at least look like:
> 
>   <xs:element name="AdaptedExceptionCA" type="xs:anyType"/>
>   <!-- the below definition should never be generated -->
>   <!--xs:complexType name="AdaptedExceptionCA">
>     <xs:sequence/>
>   </xs:complexType-->

Still valid statement IMO.

> 
> WDYT?
> 
> PS1: Just thinking loud :)
> PS2: Attached are generated WSDL sources.
> 
> On 11/30/2012 02:53 PM, Richard Opalka wrote:
>> Hi CXF folks,
>>
>> Below is copy/paste from JAXWS 2.2 spec, Section 3.7 - Service Specific
>> Exception:
>> ---
>> For exceptions that do not match the pattern described in section 2.5,
>> JAX-WS maps those exceptions to Java
>> beans and then uses those Java beans as input to the JAXB mapping.
>> ---
>>
>> I'm wondering why CXF isn't using generated 'exception' beans for JAXB
>> de/serialization & WSDL generation
>> but instead operate directly on top of exception objects? I know CXF is
>> passing TCK, but isn't it violating JAXWS spec.?
>> Most probably TCK tests doesn't cover this issue :(
>>
>> Cheers,
>>
> 


-- 
Richard Opalka
Principal Software Engineer
JBoss, by Red Hat
Cell: +420 731 186 942

Mime
View raw message