You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2015/07/12 00:18:04 UTC

[jira] [Resolved] (CAMEL-3820) cxfrs producer component should handle attachments

     [ https://issues.apache.org/jira/browse/CAMEL-3820?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-3820.
--------------------------------
    Resolution: Unresolved

CXF component has changed a lot since. Create new ticket if still relevant

> cxfrs producer component should handle attachments
> --------------------------------------------------
>
>                 Key: CAMEL-3820
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3820
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-cxf
>    Affects Versions: 2.7.0
>            Reporter: Peter Easton
>             Fix For: Future
>
>         Attachments: patch.txt
>
>
> camel-cxf producer does not support attachments, for example:
> Where:
>     <route>
>        <from uri="direct://http"/>
>        <to uri="cxfrs://http://localhost:9002"/>
>     </route>
> a send like the following should be supported.
>         Exchange exchange = template.send("direct://http", new Processor() {
>             public void process(Exchange exchange) throws Exception {
>                 exchange.setPattern(ExchangePattern.InOut);
>                 Message inMessage = exchange.getIn();
>                 inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_USING_HTTP_API, Boolean.TRUE);
>                 inMessage.setHeader(Exchange.HTTP_METHOD, "PUT");
>                 inMessage.setHeader(Exchange.CONTENT_TYPE, "multipart/related");
>                 inMessage.setHeader(Exchange.HTTP_PATH, "/customerservice/multicustomers");                
>                 inMessage.setBody(null);   
>                 inMessage.addAttachment("p1", new DataHandler(new ByteArrayDataSource("p1 content".getBytes(), "text/plain")) );
>                 inMessage.addAttachment("p2", new DataHandler(new ByteArrayDataSource("p2 content".getBytes(), "text/plain")) );
>             }
>             
>         });
> I am enclosing a suggested change to org.apache.camel.component.cxf.jaxrs.DefaultCxfRsBinding that supports attachments for the cxfrs producer.
> Note support for attachments by the cxfrs consumer component may require a separate defect.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)