Currently I have my Web Service Endpoint methods defined like so:
My (partial) configuration looks like this:Code:public @ResponsePayload SomeResponseObject getFoo(@RequestPayload SomeRequestObject request) { //... }
I thought that since I'm defining my Marshaller with contextPaths, the ObjectFactory classes located in those packages would be used for object creation. However, when I place breakpoints there it doesn't seem to be the case. Why is that, and is there a way to ensure that ObjectFactory is used? I need to do this so that I can force instantiation of some custom extension classes instead of the base generated classes.Code:@Bean public Jaxb2Marshaller marshaller() { Jaxb2Marshaller marshaller = new Jaxb2Marshaller(); marshaller.setContextPaths("com.mycompany.package1", "com.mycompany.package2", "com.mycompany.package3"); marshaller.setSchemas(schemaLocations()); return marshaller; } @Bean public MessageDispatcher messageDispatcher() { SoapMessageDispatcher dispatcher = new SoapMessageDispatcher(); dispatcher.setEndpointAdapters(Collections.<EndpointAdapter>singletonList(endpointAdapter())); return dispatcher; } @Bean public EndpointAdapter endpointAdapter() { DefaultMethodEndpointAdapter adapter = new DefaultMethodEndpointAdapter(); MarshallingPayloadMethodProcessor processor = new MarshallingPayloadMethodProcessor(marshaller()); adapter.setMethodArgumentResolvers(Collections.<MethodArgumentResolver>singletonList(processor)); adapter.setMethodReturnValueHandlers(Collections.<MethodReturnValueHandler>singletonList(processor)); return adapter; }


Reply With Quote
