spring integration - inbound-gateway unable to send reply -



spring integration - inbound-gateway unable to send reply -

the below code using spring integration 3.0.1

client side integration xml:

<int:channel id="servicetweb"></int:channel> <int:gateway id="servicetgw" default-request-channel="servicetweb" service-interface="com.test.servicetweb"> </int:gateway> <int-http:outbound-gateway url="http://testserver:8080/service-webapp/service" http-method="post" id="requesttnhttp" reply-timeout="2000" request-channel="servicetweb" message-converters="conv> </int-http:outbound-gateway> <bean id="conv" class="org.springframework.integration.http.converter.serializinghttpmessageconverter"> </bean>

web side integration xml:

<!-- next uses serviceactivator on service --> <bean id="stweb" class="test.poc.si.servicetweb"></bean> <bean id="conv" class="org.springframework.integration.http.converter.serializinghttpmessageconverter"> </bean> <int:channel id="requestchannel"></int:channel> <int:channel id="replychannel"></int:channel> <int:service-activator input-channel="requestchannel" ref="stweb" method="service" requires-reply="true" id="webserv" output-channel="replychannel"> </int:service-activator> <int-http:inbound-gateway request-channel="requestchannel" supported-methods="post" path="/service" message-converters="conv" reply-channel="replychannel"> </int-http:inbound-gateway>

the client makes request out server, server side code , processes request object, server tosses next when sending reply message:

severe: servlet.service() servlet [multipart] in context path [/service-webapp] threw exception [request processing failed; nested exception org.springframework.integration.messagingexception: not convert reply: no suitable httpmessageconverter found type [com.myobject.mreply] , take types [[text/html, image/gif, image/jpeg, /;q=.2, /;q=.2]]] root cause org.springframework.integration.messagingexception: not convert reply: no suitable httpmessageconverter found type [com.myobject.mreply] , take types [[text/html, image/gif, image/jpeg, /;q=.2, /;q=.2]

any help welcome!

assuming com.myobject.mreply serializable, seek setting expected-response-type="com.myobject.mreply" on outbound gateway. should cause take header set application/x-java-serialized-object.

edit:

or, set expected-response-type="java.io.serializable" if don't want tie specific type.

spring-integration

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -