Re: CXF component attachment support for POJO not implemented as specified

2014-11-25 Thread Paul McCulloch
Is it worth my while to submit a patch to support inbound anonymous
attachments, I guess with some configuration option to enable the feature?

Paul

On 21 November 2014 at 17:26, Paul McCulloch pkmccull...@gmail.com wrote:

 I should probably add that I am trying to handle 'anonymous' attachments -
 they are not referenced in the WSDL at all.

 On 21 November 2014 09:36, Paul McCulloch pkmccull...@gmail.com wrote:

 This test cases are for MTOM though I think. I need to use SOAP with
 Attachments for my service.

 Thanks again,

 Paul

 On 21 November 2014 05:41, Willem Jiang willem.ji...@gmail.com wrote:

 The attachment is mapped by CXF into the MessageContentList.
 Here is an unit test[1] in camel-cxf for it, you can find the wsdl file
 here[2]


 [1]
 https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/mtom/CxfMtomConsumerTest.java
 [2]
 https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/resources/mtom.wsdl

 --
 Willem Jiang

 Red Hat, Inc.
 Web: http://www.redhat.com
 Blog: http://willemjiang.blogspot.com (English)
 http://jnn.iteye.com (Chinese)
 Twitter: willemjiang
 Weibo: 姜宁willem



 On November 21, 2014 at 2:48:50 AM, Paul McCulloch (
 pkmccull...@gmail.com) wrote:
  Thanks for getting back to me Willem. I'm afraid I don't understand
 your
  reply though! What do you mean by the POJO parameter list?
 
  I thought you might mean that the attachments get added as additional
  entries to the MessageContentList - but that doesn't seem to be the
 case. I
  had a look through the source and can't find anywhere that the
 incoming CXF
  attachment is propagated to the POJO, message or exchange.
 
  My use case is implementing a WSD first SOAP service supporting Soap
  with attachments on incoming messages.
 
  Thanks,
 
  Paul
 
  On 20 November 2014 04:25, Willem Jiang wrote:
 
   Hi Paul,
  
   For the POJO, we don’t want to export the attachment from message to
 the
   user as the user can access the attachment from the POJO parameter
 list.
   If we expose the attachment throw the message API for the POJO data
   formate, it could cause some trouble if the user makes some changes
 through
   the message and POJO parameter list at same time.
  
   --
   Willem Jiang
  
   Red Hat, Inc.
   Web: http://www.redhat.com
   Blog: http://willemjiang.blogspot.com (English)
   http://jnn.iteye.com (Chinese)
   Twitter: willemjiang
   Weibo: 姜宁willem
  
  
  
   On November 20, 2014 at 12:53:17 AM, pkmcculloch (
 pkmccull...@gmail.com)
   wrote:
I agree that the work for CAMEL-7181 doesn't cover all cases.
 Looking at
   the
current source I see a couple of issues:
   
1) populateExchangeFromCxfRequest(Exchange, Exchange) doesn't check
MTOM_ENABLED - it never includes attachments for POJOs
   
2) populateCxfResponseFromExchange(Exchange, Exchange) - the same
 issue.
   
Can someone re-open the JIRA task? Or should I log a new one?
   
I'm quite happy to make the fixes. What's the best format to
 submit the
   fix
- patch or pull request?
   
Thanks,
   
Paul
   
   
   
--
View this message in context:
  
 http://camel.465427.n5.nabble.com/CXF-component-attachment-support-for-POJO-not-implemented-as-specified-tp5746952p5759332.html
Sent from the Camel - Users mailing list archive at Nabble.com.
   
  
  
 






Re: CXF component attachment support for POJO not implemented as specified

2014-11-25 Thread Willem Jiang

If we cannot access the attachment from the the MessageContentList in POJO 
model, the solution sounds good.

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 26, 2014 at 5:11:18 AM, Paul McCulloch (pkmccull...@gmail.com) 
wrote:
 Is it worth my while to submit a patch to support inbound anonymous
 attachments, I guess with some configuration option to enable the feature?
  
 Paul
  
 On 21 November 2014 at 17:26, Paul McCulloch wrote:
  
  I should probably add that I am trying to handle 'anonymous' attachments -
  they are not referenced in the WSDL at all.
 
  On 21 November 2014 09:36, Paul McCulloch wrote:
 
  This test cases are for MTOM though I think. I need to use SOAP with
  Attachments for my service.
 
  Thanks again,
 
  Paul
 
  On 21 November 2014 05:41, Willem Jiang wrote:
 
  The attachment is mapped by CXF into the MessageContentList.
  Here is an unit test[1] in camel-cxf for it, you can find the wsdl file
  here[2]
 
 
  [1]
  https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/mtom/CxfMtomConsumerTest.java

  [2]
  https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/resources/mtom.wsdl

 
  --
  Willem Jiang
 
  Red Hat, Inc.
  Web: http://www.redhat.com
  Blog: http://willemjiang.blogspot.com (English)
  http://jnn.iteye.com (Chinese)
  Twitter: willemjiang
  Weibo: 姜宁willem
 
 
 
  On November 21, 2014 at 2:48:50 AM, Paul McCulloch (
  pkmccull...@gmail.com) wrote:
   Thanks for getting back to me Willem. I'm afraid I don't understand
  your
   reply though! What do you mean by the POJO parameter list?
  
   I thought you might mean that the attachments get added as additional
   entries to the MessageContentList - but that doesn't seem to be the
  case. I
   had a look through the source and can't find anywhere that the
  incoming CXF
   attachment is propagated to the POJO, message or exchange.
  
   My use case is implementing a WSD first SOAP service supporting Soap
   with attachments on incoming messages.
  
   Thanks,
  
   Paul
  
   On 20 November 2014 04:25, Willem Jiang wrote:
  
Hi Paul,
   
For the POJO, we don’t want to export the attachment from message to
  the
user as the user can access the attachment from the POJO parameter
  list.
If we expose the attachment throw the message API for the POJO data
formate, it could cause some trouble if the user makes some changes
  through
the message and POJO parameter list at same time.
   
--
Willem Jiang
   
Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem
   
   
   
On November 20, 2014 at 12:53:17 AM, pkmcculloch (
  pkmccull...@gmail.com)
wrote:
 I agree that the work for CAMEL-7181 doesn't cover all cases.
  Looking at
the
 current source I see a couple of issues:

 1) populateExchangeFromCxfRequest(Exchange, Exchange) doesn't check
 MTOM_ENABLED - it never includes attachments for POJOs

 2) populateCxfResponseFromExchange(Exchange, Exchange) - the same
  issue.

 Can someone re-open the JIRA task? Or should I log a new one?

 I'm quite happy to make the fixes. What's the best format to
  submit the
fix
 - patch or pull request?

 Thanks,

 Paul



 --
 View this message in context:
   
  http://camel.465427.n5.nabble.com/CXF-component-attachment-support-for-POJO-not-implemented-as-specified-tp5746952p5759332.html

 Sent from the Camel - Users mailing list archive at Nabble.com.

   
   
  
 
 
 
 
  



Re: CXF component attachment support for POJO not implemented as specified

2014-11-21 Thread Paul McCulloch
This test cases are for MTOM though I think. I need to use SOAP with
Attachments for my service.

Thanks again,

Paul

On 21 November 2014 05:41, Willem Jiang willem.ji...@gmail.com wrote:

 The attachment is mapped by CXF into the MessageContentList.
 Here is an unit test[1] in camel-cxf for it, you can find the wsdl file
 here[2]


 [1]
 https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/mtom/CxfMtomConsumerTest.java
 [2]
 https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/resources/mtom.wsdl

 --
 Willem Jiang

 Red Hat, Inc.
 Web: http://www.redhat.com
 Blog: http://willemjiang.blogspot.com (English)
 http://jnn.iteye.com (Chinese)
 Twitter: willemjiang
 Weibo: 姜宁willem



 On November 21, 2014 at 2:48:50 AM, Paul McCulloch (pkmccull...@gmail.com)
 wrote:
  Thanks for getting back to me Willem. I'm afraid I don't understand your
  reply though! What do you mean by the POJO parameter list?
 
  I thought you might mean that the attachments get added as additional
  entries to the MessageContentList - but that doesn't seem to be the
 case. I
  had a look through the source and can't find anywhere that the incoming
 CXF
  attachment is propagated to the POJO, message or exchange.
 
  My use case is implementing a WSD first SOAP service supporting Soap
  with attachments on incoming messages.
 
  Thanks,
 
  Paul
 
  On 20 November 2014 04:25, Willem Jiang wrote:
 
   Hi Paul,
  
   For the POJO, we don’t want to export the attachment from message to
 the
   user as the user can access the attachment from the POJO parameter
 list.
   If we expose the attachment throw the message API for the POJO data
   formate, it could cause some trouble if the user makes some changes
 through
   the message and POJO parameter list at same time.
  
   --
   Willem Jiang
  
   Red Hat, Inc.
   Web: http://www.redhat.com
   Blog: http://willemjiang.blogspot.com (English)
   http://jnn.iteye.com (Chinese)
   Twitter: willemjiang
   Weibo: 姜宁willem
  
  
  
   On November 20, 2014 at 12:53:17 AM, pkmcculloch (
 pkmccull...@gmail.com)
   wrote:
I agree that the work for CAMEL-7181 doesn't cover all cases.
 Looking at
   the
current source I see a couple of issues:
   
1) populateExchangeFromCxfRequest(Exchange, Exchange) doesn't check
MTOM_ENABLED - it never includes attachments for POJOs
   
2) populateCxfResponseFromExchange(Exchange, Exchange) - the same
 issue.
   
Can someone re-open the JIRA task? Or should I log a new one?
   
I'm quite happy to make the fixes. What's the best format to submit
 the
   fix
- patch or pull request?
   
Thanks,
   
Paul
   
   
   
--
View this message in context:
  
 http://camel.465427.n5.nabble.com/CXF-component-attachment-support-for-POJO-not-implemented-as-specified-tp5746952p5759332.html
Sent from the Camel - Users mailing list archive at Nabble.com.
   
  
  
 




Re: CXF component attachment support for POJO not implemented as specified

2014-11-21 Thread Paul McCulloch
I should probably add that I am trying to handle 'anonymous' attachments -
they are not referenced in the WSDL at all.

On 21 November 2014 09:36, Paul McCulloch pkmccull...@gmail.com wrote:

 This test cases are for MTOM though I think. I need to use SOAP with
 Attachments for my service.

 Thanks again,

 Paul

 On 21 November 2014 05:41, Willem Jiang willem.ji...@gmail.com wrote:

 The attachment is mapped by CXF into the MessageContentList.
 Here is an unit test[1] in camel-cxf for it, you can find the wsdl file
 here[2]


 [1]
 https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/mtom/CxfMtomConsumerTest.java
 [2]
 https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/resources/mtom.wsdl

 --
 Willem Jiang

 Red Hat, Inc.
 Web: http://www.redhat.com
 Blog: http://willemjiang.blogspot.com (English)
 http://jnn.iteye.com (Chinese)
 Twitter: willemjiang
 Weibo: 姜宁willem



 On November 21, 2014 at 2:48:50 AM, Paul McCulloch (pkmccull...@gmail.com)
 wrote:
  Thanks for getting back to me Willem. I'm afraid I don't understand your
  reply though! What do you mean by the POJO parameter list?
 
  I thought you might mean that the attachments get added as additional
  entries to the MessageContentList - but that doesn't seem to be the
 case. I
  had a look through the source and can't find anywhere that the incoming
 CXF
  attachment is propagated to the POJO, message or exchange.
 
  My use case is implementing a WSD first SOAP service supporting Soap
  with attachments on incoming messages.
 
  Thanks,
 
  Paul
 
  On 20 November 2014 04:25, Willem Jiang wrote:
 
   Hi Paul,
  
   For the POJO, we don’t want to export the attachment from message to
 the
   user as the user can access the attachment from the POJO parameter
 list.
   If we expose the attachment throw the message API for the POJO data
   formate, it could cause some trouble if the user makes some changes
 through
   the message and POJO parameter list at same time.
  
   --
   Willem Jiang
  
   Red Hat, Inc.
   Web: http://www.redhat.com
   Blog: http://willemjiang.blogspot.com (English)
   http://jnn.iteye.com (Chinese)
   Twitter: willemjiang
   Weibo: 姜宁willem
  
  
  
   On November 20, 2014 at 12:53:17 AM, pkmcculloch (
 pkmccull...@gmail.com)
   wrote:
I agree that the work for CAMEL-7181 doesn't cover all cases.
 Looking at
   the
current source I see a couple of issues:
   
1) populateExchangeFromCxfRequest(Exchange, Exchange) doesn't check
MTOM_ENABLED - it never includes attachments for POJOs
   
2) populateCxfResponseFromExchange(Exchange, Exchange) - the same
 issue.
   
Can someone re-open the JIRA task? Or should I log a new one?
   
I'm quite happy to make the fixes. What's the best format to submit
 the
   fix
- patch or pull request?
   
Thanks,
   
Paul
   
   
   
--
View this message in context:
  
 http://camel.465427.n5.nabble.com/CXF-component-attachment-support-for-POJO-not-implemented-as-specified-tp5746952p5759332.html
Sent from the Camel - Users mailing list archive at Nabble.com.
   
  
  
 





Re: CXF component attachment support for POJO not implemented as specified

2014-11-20 Thread Paul McCulloch
Thanks for getting back to me Willem. I'm afraid I don't understand your
reply though! What do you mean by the POJO parameter list?

I thought you might mean that the attachments get added as additional
entries to the MessageContentList - but that doesn't seem to be the case. I
had a look through the source and can't find anywhere that the incoming CXF
attachment is propagated to the POJO, message or exchange.

My use case is implementing a WSD first SOAP service supporting Soap
with attachments on incoming messages.

Thanks,

Paul

On 20 November 2014 04:25, Willem Jiang willem.ji...@gmail.com wrote:

 Hi Paul,

 For the POJO, we don’t want to export the attachment from message to the
 user as the user can access the attachment from the POJO parameter list.
 If we expose the attachment throw the message API for the POJO data
 formate, it could cause some trouble if the user makes some changes through
 the message and POJO parameter list at same time.

 --
 Willem Jiang

 Red Hat, Inc.
 Web: http://www.redhat.com
 Blog: http://willemjiang.blogspot.com (English)
 http://jnn.iteye.com (Chinese)
 Twitter: willemjiang
 Weibo: 姜宁willem



 On November 20, 2014 at 12:53:17 AM, pkmcculloch (pkmccull...@gmail.com)
 wrote:
  I agree that the work for CAMEL-7181 doesn't cover all cases. Looking at
 the
  current source I see a couple of issues:
 
  1) populateExchangeFromCxfRequest(Exchange, Exchange) doesn't check
  MTOM_ENABLED - it never includes attachments for POJOs
 
  2) populateCxfResponseFromExchange(Exchange, Exchange) - the same issue.
 
  Can someone re-open the JIRA task? Or should I log a new one?
 
  I'm quite happy to make the fixes. What's the best format to submit the
 fix
  - patch or pull request?
 
  Thanks,
 
  Paul
 
 
 
  --
  View this message in context:
 http://camel.465427.n5.nabble.com/CXF-component-attachment-support-for-POJO-not-implemented-as-specified-tp5746952p5759332.html
  Sent from the Camel - Users mailing list archive at Nabble.com.
 




Re: CXF component attachment support for POJO not implemented as specified

2014-11-20 Thread Willem Jiang
The attachment is mapped by CXF into the MessageContentList.
Here is an unit test[1] in camel-cxf for it, you can find the wsdl file here[2]


[1]https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/mtom/CxfMtomConsumerTest.java
[2]https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/resources/mtom.wsdl

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 21, 2014 at 2:48:50 AM, Paul McCulloch (pkmccull...@gmail.com) 
wrote:
 Thanks for getting back to me Willem. I'm afraid I don't understand your
 reply though! What do you mean by the POJO parameter list?
  
 I thought you might mean that the attachments get added as additional
 entries to the MessageContentList - but that doesn't seem to be the case. I
 had a look through the source and can't find anywhere that the incoming CXF
 attachment is propagated to the POJO, message or exchange.
  
 My use case is implementing a WSD first SOAP service supporting Soap
 with attachments on incoming messages.
  
 Thanks,
  
 Paul
  
 On 20 November 2014 04:25, Willem Jiang wrote:
  
  Hi Paul,
 
  For the POJO, we don’t want to export the attachment from message to the
  user as the user can access the attachment from the POJO parameter list.
  If we expose the attachment throw the message API for the POJO data
  formate, it could cause some trouble if the user makes some changes through
  the message and POJO parameter list at same time.
 
  --
  Willem Jiang
 
  Red Hat, Inc.
  Web: http://www.redhat.com
  Blog: http://willemjiang.blogspot.com (English)
  http://jnn.iteye.com (Chinese)
  Twitter: willemjiang
  Weibo: 姜宁willem
 
 
 
  On November 20, 2014 at 12:53:17 AM, pkmcculloch (pkmccull...@gmail.com)
  wrote:
   I agree that the work for CAMEL-7181 doesn't cover all cases. Looking at
  the
   current source I see a couple of issues:
  
   1) populateExchangeFromCxfRequest(Exchange, Exchange) doesn't check
   MTOM_ENABLED - it never includes attachments for POJOs
  
   2) populateCxfResponseFromExchange(Exchange, Exchange) - the same issue.
  
   Can someone re-open the JIRA task? Or should I log a new one?
  
   I'm quite happy to make the fixes. What's the best format to submit the
  fix
   - patch or pull request?
  
   Thanks,
  
   Paul
  
  
  
   --
   View this message in context:
  http://camel.465427.n5.nabble.com/CXF-component-attachment-support-for-POJO-not-implemented-as-specified-tp5746952p5759332.html

   Sent from the Camel - Users mailing list archive at Nabble.com.
  
 
 
  



Re: CXF component attachment support for POJO not implemented as specified

2014-11-19 Thread pkmcculloch
I agree that the work for CAMEL-7181 doesn't cover all cases. Looking at the
current source I see a couple of issues:

1) populateExchangeFromCxfRequest(Exchange, Exchange) doesn't check
MTOM_ENABLED - it never includes attachments for POJOs

2) populateCxfResponseFromExchange(Exchange, Exchange)  - the same issue.

Can someone re-open the JIRA task? Or should I log a new one?

I'm quite happy to make the fixes. What's the best format to submit the fix
- patch or pull request?

Thanks,

Paul



--
View this message in context: 
http://camel.465427.n5.nabble.com/CXF-component-attachment-support-for-POJO-not-implemented-as-specified-tp5746952p5759332.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CXF component attachment support for POJO not implemented as specified

2014-11-19 Thread Willem Jiang
Hi Paul,

For the POJO, we don’t want to export the attachment from message to the user 
as the user can access the attachment from the POJO parameter list.
If we expose the attachment throw the message API for the POJO data formate, it 
could cause some trouble if the user makes some changes through the message and 
POJO parameter list at same time. 

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 20, 2014 at 12:53:17 AM, pkmcculloch (pkmccull...@gmail.com) wrote:
 I agree that the work for CAMEL-7181 doesn't cover all cases. Looking at the
 current source I see a couple of issues:
  
 1) populateExchangeFromCxfRequest(Exchange, Exchange) doesn't check
 MTOM_ENABLED - it never includes attachments for POJOs
  
 2) populateCxfResponseFromExchange(Exchange, Exchange) - the same issue.
  
 Can someone re-open the JIRA task? Or should I log a new one?
  
 I'm quite happy to make the fixes. What's the best format to submit the fix
 - patch or pull request?
  
 Thanks,
  
 Paul
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/CXF-component-attachment-support-for-POJO-not-implemented-as-specified-tp5746952p5759332.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



Re: CXF component attachment support for POJO not implemented as specified

2014-02-08 Thread yirco
Hi Willem,

thank you.

I have two comments:

1) It is used in three methods, one for producer and two for consumer. I
believe it should be changed in all the methods so that it works in both
directions.

/populateExchangeFromCxfResponse(Exchange camelExchange,
org.apache.cxf.message.Exchange cxfExchange, 
MapString, Object responseContext)
populateExchangeFromCxfRequest(org.apache.cxf.message.Exchange cxfExchange,
Exchange camelExchange)
populateCxfResponseFromExchange(Exchange camelExchange, 
org.apache.cxf.message.Exchange cxfExchange)/

2) Are you sure that this condition is correct?

If it is POJO and XOP then the whole condition shall be false.
!(true  !true) - !(true  false) - !(false) - true

/ boolean isXop =
Boolean.valueOf(camelExchange.getProperty(Message.MTOM_ENABLED,
String.class));
 // propagate attachments if the data format is not POJO with MTOM enabled
 if (cxfMessage.getAttachments() != null 
!(DataFormat.POJO.equals(dataFormat)  !isXop)) {
// propagate attachments
/




--
View this message in context: 
http://camel.465427.n5.nabble.com/CXF-component-attachment-support-for-POJO-not-implemented-as-specified-tp5746952p5746990.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CXF component attachment support for POJO not implemented as specified

2014-02-07 Thread Willem Jiang
It makes sense, I just filled a JIRA[1] for it.

[1]https://issues.apache.org/jira/browse/CAMEL-7181

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com(http://willemjiang.blogspot.com/) 
(English)
http://jnn.iteye.com(http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On February 8, 2014 at 9:35:48 AM, yirco (netswengin...@yahoo.com) wrote:
  
 Hi,
  
 the CXF description states:
  
 http://camel.apache.org/cxf.html#CXF-AttachmentSupport  
  
  
 Attachment Support
  
 /POJO Mode:
  
 Attachments are propagated to Camel message's attachments  
 since 2.1. So, it
 is possible to retreive attachments by Camel Message API
  
 DataHandler Message.getAttachment(String id)/
  
 However, /org.apache.camel.component.cxf.DefaultCxfBinding/  
 explicitly
 excludes attachments propagation for POJOs. This makes processing  
 legacy
 SOAP with attachments more difficult.
  
 I suggest easing the condition for POJOs that do not use MTOM:  
  
 if dataFormat is POJO and properties.mtom-enabled is false,  
 propagate the
 attachments into and from the camel Exchange.
  
 Thank you.
  
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/CXF-component-attachment-support-for-POJO-not-implemented-as-specified-tp5746952.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.