You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Tamas Kis <Ta...@ivyteam.ch> on 2010/09/02 09:07:18 UTC

WG: [not SPAM] Re: Re: Hint is needed: JAXB custom binding in CXF without Annotations

 

Hi All

 

Reading through all available material (incl. suggested by Glen) on
XmlJavaTypeAdapter-s there are still some unclear points for me.

 

a, which configuration file is used by CXF for specification of global
Type adapters?

 

> see first bulletted note below it for examples on print/parse methods.

Binding files are explicitly specified in all examples (wsdl2java) and
documentation. 

(> > Would you please give some hint where is this file in CXF??)

 

i use CXF from Java code to publish POJO services, and i suggest that
some .jxb file is used to declare binding configuration (e.g. global).

Well, there are ~16 binding files.

(i have already tried to extend many, without any success)

 

[image: i cannot sent embedded image - cause my mail would be recognised
as SPAM]

 

 

Using a jaxb.properties you can only deliver a JAXBContext factory -> a
JAXBContext (not the right place to specify _explicit_ custom bindings
without annotations, e.g. for java.lang.Number)

 

b, I do not thing that you can set custom databindings by program code
over the JAXBDataBinding class either. Is ist right?

 

e.g. 

    JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();

    TstAllIvyScriptTypesServiceImpl srvImplementor = new
TstAllIvyScriptTypesServiceImpl();

    factory.setServiceBean(srvImplementor);

    

    DataBinding dataBinding = new
JAXBDataBinding(java.lang.Number.class,NumberJaxbAdapter.class);
//nothing good

    factory.getBindingConfig().getBindingId(); //no custom type binding
stuff here, isn't it??

    factory.setDataBinding(dataBinding);

 

c, In case i am right and some .jxb configuration file must be used,
then according to a bug archive mail parse and print methods must be
used for web services, because the adapter tag is ignored.

Could anyone confirm this?

 

<jaxb:globalBindings generateIsSetMethod="true">

     <jaxb:javaType name="java.lang.Number" xmlType="xs:mynumber"

<!-- instead of this

   adapter="ch.ivyteam.jaxb.number.NumberJaxbAdapter"  one must declare
2 static methods as adapter, e.g. -->

 parseMethod="ch.ivyteam.jaxb.number.NumberJaxbAdapter.parseNumber"

 
printMethod="ch.ivyteam.jaxb.number.NumberJaxbAdapter.printNumber"/>

   </jxb:globalBindings>

 

Thanks in advance.

Best regards

Tamas

 

________________________________________________________________________
_____

Tamas Kis, M.Sc.

ivyTeam AG
Alpenstrasse 9
6300 Zug