Hi
On 04/07/13 08:16, jamalissimo wrote:
Hello guys,
I have working file upload route(
http://camel.465427.n5.nabble.com/Send-file-via-POST-request-td5728674.html#a5729109
). Only problem is that I can send only file which is located at the same
server as Karaf. My workflow is like this:
Server with upload form -> Upload to server with Karaf -> Save it as
temporary file -> Take file from temp -> Send @POST request as
MultiPartEntity -> Save it to server with documents
I am using Karaf 2.3.1, Camel 2.11 and I noticed in
http://camel.apache.org/cxfrs.html that InputStream can be used for request
binding, but I did not find any example or hint how to do that.
I believe you can use cxfrs simple binding to accept multipart payloads
and then reuse the accepted payload, as InputStream in your case, with
cxfrs producer - I haven't tried this option, so please experiment.
I'm sure there are other options there with Camel Jetty, etc.
Now, as far as cxfrs is concerned, one option is to use CXF JAX-RS
endpoint directly and link to it from Camel Servlet via camel transport,
so you'd have something like
@POST
public void upload (InputStream is) {
WebClient.create(targetAddress).type("multipart/form-data").post(is);
}
Cheers, Sergey
Thanks for advice
-Roman
--
View this message in context:
http://camel.465427.n5.nabble.com/File-upload-tp5735172.html
Sent from the Camel - Users mailing list archive at Nabble.com.