You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Benson Margulies <bi...@gmail.com> on 2009/03/26 13:35:21 UTC

Re: Simplest way in CXF to customize XML serialization for JAXWS WSDL-first services?

For  Aegis, there is a some information on Confluence, and there are test
cases in the source tree of customization.


On Wed, Mar 25, 2009 at 5:46 PM, Joe-D Morrison <jo...@db.com>wrote:

> I'm porting an application from XFire to CXF. The XFire implementation was
> a code-first design with a customized serializer for one of the types.
> That code obtained a reference to the type registry using this Spring
> reference:
>
> xfire.typeMappingRegistry
>
> and then registered a custom type with the default type mapping.
>
> The new CXF implementation is WSDL first, using JAXWS + JAXB. What's the
> cleanest way to customize the serialization for one type?
>
> One possibility is to add JAXB customizations to the jaxws:endpoint, i.e.
>
>  <bean class="org.apache.cxf.jaxb.JAXBDataBinding">
>        <property name="contextProperties">
>                <map>
>                        ????
>                </map>
>        </property>
>      </bean>
>
> Another possibility is to switch from JAXB to Aegis.
>
> In either case how do you get access to the type registry from code to add
> a mapping?  I read everything relevant I could find in the forums and
> tried the Aegis solution:
>
> <bean id="aegisDataBinding" class="org.apache.cxf.aegis.databinding
> .AegisDatabinding" scope="prototype" />
>
>  <jaxws:endpoint ...>
>        <jaxws:serviceFactory>
>                <bean class="org.apache.cxf.jaxws
> .support.JaxWsServiceFactoryBean">
>                        <property name="dataBinding" ref
> ="aegisDataBinding" />
>                </bean>
>        </jaxws:serviceFactory>
>
> and then added my custom type mapping this way:
>
> dataBinding.getAegisContext().getTypeMapping().register(new
> CustomizedType());
>
> but that seemed to result in a completely empty type mapping that couldn't
> serialize anything.
>
> Is there any kind of HOWTO for this, the equivalent of this page
> http://xfire.codehaus.org/Custom+Types but for CXF instead of XFire?
>
> Thanks for any guidance,
> - Joe
>
> --
> Joe Morrison, Lab49                                     Cell +1 (917)
> 952-2935
> http://www.lab49.com                                    Desk +1 (212)
> 250-8486
>
>
>
> ---
> This communication may contain confidential and/or privileged information.
> If you are not the intended recipient (or have received this communication
> in error) please notify the sender immediately and destroy this
> communication. Any unauthorized copying, disclosure or distribution of the
> material in this communication is strictly forbidden.
>
> Deutsche Bank does not render legal or tax advice, and the information
> contained in this communication should not be regarded as such.