On Jan 27, 2013, at 3:37 AM, Avner Levy <[email protected]> wrote:

> In the past I've posted a question about reusing jaxb context between 
> services.
> Daniel Kulp suggested configure a data binding object in the following form 
> (for the specific scenario):
> 
> <jaxws:endpoint xmlns:tns="urn:ihe:iti:xcpd:2009" .......>
>    <jaxws:dataBinding>
>        <bean class="org.apache.cxf.jaxb.JAXBDataBinding" >
>            <constructor-arg index="0" ref="globalJAXBContextBean"/>
>        </bean>
>    </jaxws:dataBinding>
> 
> I've tried to do the same through code:
> 
>    jaxwsEndpoint.getProperties().put("org.apache.cxf.jaxb.JAXBDataBinding", 
> jaxbDataBinding);
> before calling:
>    jaxwsEndpoint.publish(URL);

The data binding isn't a property in the jaxws:endpoint, otherwise it would be 
set in a <jaxws:properties> type element.

To do this, you would need to use the JaxWsServerFactoryBean to create a server 
instead of the Endpoint.publish methods.  The server factory has a 
setDataBinding method on it that can be used.

Dan



> 
> And the service starts very fast as if they are reusing the context in the 
> jaxbDataBinding object passed.
> But when connecting later I've discovered that the service context contains 
> only 50 classes while the original contained 700.
> Any idea how come I finish with a different context?
> Thanks in advance,
>   Avner
> 

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

Reply via email to