You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Alessio Soldano <as...@redhat.com> on 2009/04/02 13:11:41 UTC

wsdl2java and @XmlJavaTypeAdapter

Hi,
I'm working on some failures in the JAXWS module of the JavaEE CTS TCK 
using JBossWS-CXF (ie. the jbossws integration stack leveraging Apache CXF).
Currently I see CXF seems not to add the 
javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter annotation when 
running the wsdl2java tool against a wsdl with a message like this:
<message name="inoutSimpleTypesResponse">
    ...
    <part name="varHexBinary" type="xsd:hexBinary" />
</message>

AFAIK this should cause the corresponding param in one of the SEI method 
to have a @XmlJavaTypeAdapter(HexBinaryAdapter.class) .
Looking at the code and at JIRA, it seems to me CXF cares about that 
annotation only when doing java2ws and when dealing with wrappers 
(https://issues.apache.org/jira/browse/CXF-1178).
Am I missing something / is there a specific reason why the annotation 
is not generated by java2wsdl?
I might look at this issue and think about a solution, but I'd prefer an 
insider opinion first ;-)
Thanks
Alessio

-- 
Alessio Soldano
Web Service Lead
JBoss, a division of Red Hat


Re: wsdl2java and @XmlJavaTypeAdapter

Posted by Alessio Soldano <as...@redhat.com>.
Alessio Soldano wrote:
> Hi Dan,
>
> Daniel Kulp wrote:
>> Honestly, it's probably just a case of the standalone TCK not running 
>> into it and no one else reporting it yet.   Thus, it's a bug that 
>> needs to be fixed.   :-)
>>
>>   
> OK, I'll work on enabling this feature (adding that annotation to SEI 
> methods and params) through a proper Annotator class then.
> Jira issue: https://issues.apache.org/jira/browse/CXF-2148
>
I've attached a patch there for providing a XmlJavaTypeAdapterAnnotator 
that is added to JavaMethod and JavaParameter instances when 
xsd:hexBinary is specified (rpc/lit and doc/lit-bare).
Currently the annotator only supports annotating methods and parameters 
even if the @XmlJavaTypeAdapter has 
@Target({PACKAGE,FIELD,METHOD,TYPE,PARAMETER}); the reason is that I 
don't see usecases (consider we're dealing with tools, wsdl->java) 
requiring us to annotate other things. Anyway this can be extended if 
required in future.
Finally, currently the only adapter we take care about is the 
HexBinaryAdapter, as it's the only one that seems (at least to me) to be 
actually required when doing wsdl->java. After all that's the only one 
required to pass the (quite comprehensive) 
com/sun/ts/tests/jaxws/ee/w2j/rpc/literal/parametermodetest JavaEE5 CTS 
TCK reverse test.
Anyway, in case of future need, the new annotator of course works with 
any other adapter.
Cheers
Alessio

-- 
Alessio Soldano
Web Service Lead
JBoss, a division of Red Hat


Re: wsdl2java and @XmlJavaTypeAdapter

Posted by Alessio Soldano <as...@redhat.com>.
Hi Dan,

Daniel Kulp wrote:
> Honestly, it's probably just a case of the standalone TCK not running into it 
> and no one else reporting it yet.   Thus, it's a bug that needs to be fixed.   
> :-)
>
>   
OK, I'll work on enabling this feature (adding that annotation to SEI 
methods and params) through a proper Annotator class then.
Jira issue: https://issues.apache.org/jira/browse/CXF-2148

Thanks
Alessio

-- 
Alessio Soldano
Web Service Lead
JBoss, a division of Red Hat


Re: wsdl2java and @XmlJavaTypeAdapter

Posted by Daniel Kulp <dk...@apache.org>.
On Thu April 2 2009 7:11:41 am Alessio Soldano wrote:
> Hi,
> I'm working on some failures in the JAXWS module of the JavaEE CTS TCK
> using JBossWS-CXF (ie. the jbossws integration stack leveraging Apache
> CXF). Currently I see CXF seems not to add the
> javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter annotation when
> running the wsdl2java tool against a wsdl with a message like this:
> <message name="inoutSimpleTypesResponse">
>     ...
>     <part name="varHexBinary" type="xsd:hexBinary" />
> </message>
>
> AFAIK this should cause the corresponding param in one of the SEI method
> to have a @XmlJavaTypeAdapter(HexBinaryAdapter.class) .
> Looking at the code and at JIRA, it seems to me CXF cares about that
> annotation only when doing java2ws and when dealing with wrappers
> (https://issues.apache.org/jira/browse/CXF-1178).
> Am I missing something / is there a specific reason why the annotation
> is not generated by java2wsdl?
> I might look at this issue and think about a solution, but I'd prefer an
> insider opinion first ;-)
> Thanks
> Alessio

Honestly, it's probably just a case of the standalone TCK not running into it 
and no one else reporting it yet.   Thus, it's a bug that needs to be fixed.   
:-)

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog