Am 14.03.2011 19:48, schrieb Claus Ibsen:
Hi Harald
Nice blog btw on the JMS.
Thanks :-)
I remember adding support for serialized objects over HTTP recently.
Basically you need to set the content-type to indicate that. Let me
find an unit test.
https://svn.apache.org/repos/asf/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/javabody/HttpJavaBodyTest.java
This is the content-type
application/x-java-serialized-object
And you need Camel 2.6
Actually, that's one of the things I've already tried, using a route
like this:
from("direct.start")
.setHeader(Exchange.CONTENT_TYPE,
constant(HttpConstants.CONTENT_TYPE_JAVA_SERIALIZED_OBJECT))
.to("http://localhost:9999/hello");
Setting the header, I can send a message for my proxy method invocation,
but then there's another issue with the reply message:
For all proxy methods with a void return type, I get an EOFException
when processing the reply. Non-void return types like String are ok, though.
It seems setting the header implies that the HTTP Response is also
treated like a serialized object, and the case "empty response = void
return" is missing somehow...
Best regards,
Harald