I see in the reference manual it states incoming requests are converted to a Message object:
This allows me to use Message<String> throughout my code, and the endpoint service-activator returns a Message<String>. The string in the Message payload is XML.Code:The HttpRequestHandlingMessagingGateway accepts a list of HttpMessageConverter instances or else relies on a default list. The converters allow customization of the mapping from HttpServletRequest to Message.
When this Message gets back to the HttpRequestHandlingMessagingGateway, none of the default converters can convert the GenericMessage class to a response to return.
The error is:
The test code I have uses HttpClient 4, with "text/xml" content.Code:Servlet failed with Exception org.springframework.integration.MessagingException: Could not convert reply: no suitable HttpMessageConverter found for type [org.springframework.integration.MessagingException] and accept types [[*/*]]
I debugged into the SI code and did not see where this class and its default converters are designed to handle a Message with a String XML, and return the payload XML as a response. Since it has the property 'replyChannel' I assume it would handle this.
Is there something else I need to specify?
This is the context bean:
And this is in the web.xml:Code:<beans:bean id="inboundGateway" class="org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway"> <beans:property name="requestChannel" ref="rawXmlRequestChannel"/> <beans:property name="replyChannel" ref="outgoingHttpChannel"/> <beans:property name="requestTimeout" value="30000"/> <beans:property name="replyTimeout" value="10000"/> <beans:property name="convertExceptions" value="true" /> </beans:bean>
Code:<servlet> <servlet-name>inboundGateway</servlet-name> <servlet-class>org.springframework.web.context.support.HttpRequestHandlerServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:/sif/applicationContext.xml</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>inboundGateway</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping>


Reply With Quote
roperty name="extractReplyPayload" value="false"/>, and the payload is now sent back to the client.