Hi guys,
as part of another thread I raised, and because I have difficulty to create the message factory. I wanted to check how Spring is injecting the messageFactory.
So my endpoint is as shown below
In my context file, I have not defined any message factory and only my beans are defined. Along with the following Spring ws elementsCode:@PayloadRoot(namespace = NAMESPACE_URI, localPart = "findByCusIdRequest") @ResponsePayload @Transactional(readOnly=true) public SearchCustomerResponse method1(@RequestPayload Element customerSearchOptions) throws JDOMException, JAXBException
Code:<sws:annotation-driven/> <sws:dynamic-wsdl id="cusSearchServiceInterface" portTypeName="CusSearchServicePort" locationUri="http://server/context/customerSearchService/" targetNamespace="http://etc/definitions"> <sws:xsd location="/WEB-INF/cus-request.xsd"/> </sws:dynamic-wsdl>
So I followed the code and reached to MessageDispatcherServlet and saw that the message factory is being set as shown below, and there is a defaultStrategiesHelper being used.
Code:private void initWebServiceMessageFactory(ApplicationContext context) { WebServiceMessageFactory messageFactory; try { messageFactory = context.getBean(getMessageFactoryBeanName(), WebServiceMessageFactory.class); } catch (NoSuchBeanDefinitionException ignored) { messageFactory = defaultStrategiesHelper .getDefaultStrategy(WebServiceMessageFactory.class, context); if (logger.isDebugEnabled()) { logger.debug("No WebServiceMessageFactory found in servlet '" + getServletName() + "': using default"); } } messageReceiverHandlerAdapter.setMessageFactory(messageFactory); }
Upon reaching the DefaultStrategiesHelper, things are not that clear and I wondering if somebody could shed some light.
When and how are the properties of the DefaultStrategiesHelper set. And from there how are the various message factories chosen.
Thanks
Kris


Reply With Quote