Lars,

If you want the browser to receive the attachment file content, you probably need to build a custom HttpConsumerMarshaler (a new feature of ServiceMix 3.2). I'm afraid that particular is currently undocumented on the website, but a similar feature (the new JMS consumer endpoint and the use of a Marshaler there) is documented on http://servicemix.apache.org/servicemix-jms-new-endpoints.html

The HttpConsumerMarshaler basically allows you to create your own MessageExchange with the HTTP request you receive and to build a custom HTTP response based on the MessageExchange that is returned to the <http:consumer/> endpoint. You need to build a class that implements this interface and configure it on the <http:consumer/> enpoint. There's no additional documentation/examples available, so just get back to us if you run into problems "en cours de route".


Gert

lhe77 wrote:
Unfortunately I am still not able to get this working.

What do I want to do with it:

1. a user uploads a file using a simple upload form
2. when hitting the send button, the form data is send to the http-consumer
3. the http consumer uses InOut MEP and is forwarding the message to the
handler bean
4. the handler bean is extracting the data (name and content of the file)
5. the handler is modifying the file contents (for example converting to
another file format)
6. the handler fills the modified file to the attachment of the out message
7. the handler fills the content of the out message with <payload/> as dummy
content
8. the handler sends the message back to the http-consumer
9. the browser now pops up a window to save the modified file

thats it...

The reality is a little different. Up to point 8 everything works fine. Step
9 is not working. The browser gets some multipart message but not containing
any file content. (see the posts in this thread)
I would expect that if I send a out message to the http-consumer, only
containing an attachment and a dummy xml content (maybe here an empty
content should be made allowed) that this attachment is used to put out a
stream to the client, sending the pure file. (as a download would work)

The question is now if my expectations are that wrong or is smix just not
working as it should?
What I try to prevent is making my own jetty binding component for that
issue.

Thanks for any advice,
Lars


Reply via email to