cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <>
Subject Re: Schemas passed by ServiceFactoryBean.setSchemaLocation() are not accessible in DataBinding model
Date Wed, 16 Jun 2010 18:28:39 GMT

I'd be OK with either option.   It probably does make some sense to push it up 
a level.   Nice job investigating it.

We'd need to get the patch attached to a JIRA, though.


On Wednesday 16 June 2010 6:28:40 am Nilupa Bandara wrote:
> Hi,
> I am working on implementing the JiBX databinding implementation for Apache
> CXF and I've come across the following situation which I think could be a
> possible shortcoming. I've also attached two patches as a solution for
> that.
> I've used the following code to start up a simple service and I've used
> serviceFactoryBean.setSchemaLocations() method to pass a list of schema
> locations.
> LibraryServiceImpl libraryServiceImpl = new LibraryServiceImpl();
> ServerFactoryBean svrFactory = new ServerFactoryBean();
> ArrayList<String> schemaLocations = new ArrayList<String>();
> schemaLocations.add("file:///home/nilupa/Documents/experiment/types.xsd");
> svrFactory.setSchemaLocations(schemaLocations);
> svrFactory.setServiceClass(LibraryService.class);
> svrFactory.setAddress("http://localhost:8080/LibraryService");
> svrFactory.setServiceBean(libraryServiceImpl);
> svrFactory.getServiceFactory().setDataBinding(new JiBXDataBinding());
> svrFactory.create();
> However that information is inaccessible in the service model or in the
> AbstractDataBinding classes. When I looked in more deeply I found that
> AbstarctDataBinding is populated with  schemas that are specified
> by serviceFactoryBean.setSchemaLocations() when no DataBinding is specified
> and when ReflectionServiceFactoryBean.createDefaultDataBinding() is
> invoked. I think AbstarctDataBinding should be populated not only when no
> databinding is specified but also when particular databinding object is
> provided with schemas specified by setSchemaLocations() method.
> In my propose fix ReflectionServiceFactoryBean.fillDataBindingSchemas()
> method does the actual filling and it is invoked before
> AbstractServiceFactoryBean.initializeDataBindings() is invoked in
> ReflectionServiceFactoryBean.initializeDataBindings() method. Perhaps we
> should implement  fillDataBindingSchemas() in AbstractServiceFactoryBean
> class instead of ReflectionServiceFactoryBean class.
> Any thoughts ?
> Thanks & Best Regards,
> Nilupa

Daniel Kulp

View raw message