Hi,
I was able to run the http sample without any problem. But I have been having problems trying to run a slightly different example -
public interface RequestGateway {
public Order createOrder(Order order);
}
public class Order implements Serializable {
private Integer id;
private String item;
private Integer quantity;
// setters and getters
}
public class OrderReceiver {
public Order createOrder(Order order) {
order.setId(1);
return order;
}
}
On the client side, I have -
<int:gateway id="requestGateway"
service-interface="org.springframework.integration.samples .http.RequestGateway"
default-request-channel="requestChannel"/>
<int:channel id="requestChannel"/>
<int-http:outbound-gateway request-channel="requestChannel" url="http://localhost:8080/http/receiveGateway" http-method="POST"/>
On the server side, I have -
<bean name="/receiveGateway" class="org.springframework.integration.samples.htt p.CustomMessagingGateway" >
<constructor-arg value="true" />
<property name="requestChannel" ref="receiveChannel" />
<property name="replyChannel" ref="responseChannel" />
<property name="supportedMethods" >
<list>
<value>POST</value>
<value>GET</value>
</list>
</property>
<property name="messageConverters">
<list>
<bean class="org.springframework.integration.http.conver ter.SerializingHttpMessageConverter">
<property name="supportedMediaTypes" value="application/x-java-serialized-object" />
</bean>
</list>
</property>
</bean>
<int:channel id="receiveChannel"/>
<int:channel id="responseChannel"/>
<int:service-activator id="orderReceiver" input-channel="receiveChannel">
<bean class="org.springframework.integration.samples.htt p.OrderReceiver"/>
</int:service-activator>
I keep getting an error -
org.springframework.integration.MessagingException : Could not convert reply: no suitable HttpMessageConverter found for type [Order] and accept types [[text/html, image/gif, image/jpeg, */*;q=.2, */*;q=.2]]
Please help.
Thanks.


Reply With Quote
