camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Stiborsk√Ĺ <martin.stibor...@gmail.com>
Subject Fetching webpages with CXF on the producer endpoint side
Date Fri, 04 Jan 2013 13:23:35 GMT
Hi,
I have a simple case - CXF as producer and based on the HTTP request
parameters, I need fetch some web page - with help of Camel HTTP component,
I guess.

For start, simple code:

from("cxfrs:bean:jenkinsServer")
.choice()
.when(header(CxfConstants.OPERATION_NAME).isEqualTo("test"))
.to("http://www.google.com?bridgeEndpoint=true&throwExceptionOnFailure=false
")

I'd expect, that after I hit a "localhost:1234/test" in my browser, I'll
see a google.com source code, wrong :( Actually, I've got an exception:

org.apache.camel.InvalidPayloadException: No body available of type:
java.io.InputStream but has value: [] of type:
org.apache.cxf.message.MessageContentsList on: Message: []. Caused by: No
type converter available to convert from type:
org.apache.cxf.message.MessageContentsList to the required type:
java.io.InputStream with value []. Exchange[Message: []]. Caused by:
[org.apache.camel.NoTypeConversionAvailableException - No type converter
available to convert from type: org.apache.cxf.message.MessageContentsList
to the required type: java.io.InputStream with value []]

Now, after so many tries and googling, I'm not sure why and where it's
wrong...

Is there a way how to make it work? Sure I can write my own bean to
fetching data with HTTP requests, but I was thinking that Camel HTTP
component could be capable of that.

-- 
S pozdravem / Best regards
Martin Stiborsk√Ĺ

Jabber: stibi@njs.netlab.cz
Twitter: http://www.twitter.com/stibi

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message