Return-Path: X-Original-To: apmail-cxf-users-archive@www.apache.org Delivered-To: apmail-cxf-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 029F81086A for ; Thu, 20 Feb 2014 08:13:52 +0000 (UTC) Received: (qmail 47643 invoked by uid 500); 20 Feb 2014 08:13:48 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 47450 invoked by uid 500); 20 Feb 2014 08:13:44 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 47381 invoked by uid 99); 20 Feb 2014 08:13:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Feb 2014 08:13:42 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_IMAGE_RATIO_06,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ashakirin@talend.com designates 64.95.72.217 as permitted sender) Received: from [64.95.72.217] (HELO mxout.myoutlookonline.com) (64.95.72.217) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Feb 2014 08:13:30 +0000 Received: from mxout.myoutlookonline.com (localhost [127.0.0.1]) by mxout.myoutlookonline.com (Postfix) with ESMTP id 5C75C41683B; Thu, 20 Feb 2014 03:13:07 -0500 (EST) X-Virus-Scanned: by SpamTitan at mail.lan Received: from S10HUB003.SH10.lan (unknown [10.110.2.1]) by mxout.myoutlookonline.com (Postfix) with ESMTP id A904F41685F; Thu, 20 Feb 2014 03:13:04 -0500 (EST) Received: from S10BE002.SH10.lan ([::1]) by S10HUB003.SH10.lan ([::1]) with mapi id 14.01.0379.000; Thu, 20 Feb 2014 03:13:04 -0500 From: Andrei Shakirin To: "users@cxf.apache.org" CC: "Gumudavelli, Alekhya" Subject: RE: Query on CXF dispatch client with MTOM Thread-Topic: Query on CXF dispatch client with MTOM Thread-Index: Ac8mMlZ+Spua3EhBQVmwEfleNlgLHgAShxxAACZ1atAADkgdAAApCjzgAAZlyVAAHAXyAAEKft5wADvXQFA= Date: Thu, 20 Feb 2014 08:13:03 +0000 Message-ID: References: <3A8936ECCAAF4349876B52CC4A6A693E1241FC@EXHYDMB2.rpega.com> <3A8936ECCAAF4349876B52CC4A6A693E124544@EXHYDMB2.rpega.com> <3A8936ECCAAF4349876B52CC4A6A693E124832@EXHYDMB2.rpega.com> <3A8936ECCAAF4349876B52CC4A6A693E124A93@EXHYDMB2.rpega.com> <3A8936ECCAAF4349876B52CC4A6A693E126F17@EXHYDMB2.rpega.com> In-Reply-To: <3A8936ECCAAF4349876B52CC4A6A693E126F17@EXHYDMB2.rpega.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [88.67.61.206] Content-Type: multipart/related; boundary="_004_D225CD69196F3F4A9F4174B2FCA06F8811E8FA10S10BE002SH10lan_"; type="multipart/alternative" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_004_D225CD69196F3F4A9F4174B2FCA06F8811E8FA10S10BE002SH10lan_ Content-Type: multipart/alternative; boundary="_000_D225CD69196F3F4A9F4174B2FCA06F8811E8FA10S10BE002SH10lan_" --_000_D225CD69196F3F4A9F4174B2FCA06F8811E8FA10S10BE002SH10lan_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I got the issue now, sorry for delay. The problem is that if you use WSDL or Java first approaches, you say CXF w= here inject a reference to sending binary data: - for WSDL using - for java using annotation: @XmlMimeType("application/octet-stream") protected DataHandler imageData; In case of using Dispatch interface and SOAPMessage, user is responsible to= build complete SOAP message and, as a result, to insert = element. Currently CXF has no information where this element should be added in SOAP= Message body. I think that could be a useful extension to provide additional property for= example in form of XPath and automate that for SOAPMessage as well. Patch is welcome. Regards, Andrei. From: Gumudavelli, Alekhya [mailto:Alekhya.Gumudavelli@in.pega.com] Sent: Dienstag, 18. Februar 2014 13:53 To: Andrei Shakirin; users@cxf.apache.org Subject: RE: Query on CXF dispatch client with MTOM Importance: High Hi Andrei, Any update on this. I raised a JIRA item on the same last week. Could someo= ne please look into it. https://issues.apache.org/jira/browse/CXF-5560 Let me know if you need more details on the issue. Regards, Alekhya From: Gumudavelli, Alekhya Sent: Thursday, February 13, 2014 11:42 AM To: Andrei Shakirin; users@cxf.apache.org Subject: RE: Query on CXF dispatch client with MTOM Hi, I am attaching the client and service that I am using. MTOMClient.java is = a standalone Java program that I wrote to connect to a service that I got f= rom CXF samples apache-cxf-3.0.0-milestone1.rar ( apache-cxf-3.0.0-milestone1\samples\mtom ). links.txt is the file I am = trying to send as an MTOM attachment. I am also attaching MTOMClientBase64.java. It sends a base64 encoded data o= f the attachment. Regards, Alekhya From: Andrei Shakirin [mailto:ashakirin@talend.com] Sent: Wednesday, February 12, 2014 9:43 PM To: users@cxf.apache.org Cc: Gumudavelli, Alekhya Subject: RE: Query on CXF dispatch client with MTOM Hi, Interesting. Any chance to create a small test case to reproduce that? Regards, Andrei. From: Gumudavelli, Alekhya [mailto:Alekhya.Gumudavelli@in.pega.com] Sent: Mittwoch, 12. Februar 2014 14:26 To: Andrei Shakirin; users@cxf.apache.org Subject: RE: Query on CXF dispatch client with MTOM Hi, I don't find any difference between my client code and https://svn.apache.o= rg/repos/asf/cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apac= he/cxf/systest/swa/ClientServerSwaTest.java except that I am doing an addit= ional setting MTOMEnabled property to true. Can you give me any MTOM specific sample test (not just SWA). I would like = to try that out directly. I had searched in cxf/systest/ repository but cou= ld not find any. I see that all MTOM tests in the repo use stubs and not di= spatch API. Or can you point me to the internal CXF code / class that takes care of add= ing element. I would like to debug and understand why is it n= ot xop'ing it. We are revamping our entire stack to use CXF and this issue is hindering us= from implementing MTOM with CXF, one of the important features for clients= . Thanks much for the quick responses Andrei! Alekhya From: Andrei Shakirin [mailto:ashakirin@talend.com] Sent: Tuesday, February 11, 2014 11:06 PM To: users@cxf.apache.org Cc: Gumudavelli, Alekhya Subject: RE: Query on CXF dispatch client with MTOM Hi, It is quite difficult to say what exactly wrong without your test case. Could you run the system test I referenced in last mail and try to find the= difference between test and your code? Regards, Andrei. From: Gumudavelli, Alekhya [mailto:Alekhya.Gumudavelli@in.pega.com] Sent: Dienstag, 11. Februar 2014 12:54 To: Andrei Shakirin; users@cxf.apache.org Subject: RE: Query on CXF dispatch client with MTOM Hi Andrei, I am doing exactly the way you are referring. The service is not able to re= cognize attachment. Below is my service method . It fails to process attachment as the paramete= r "attachinfo" does not hold the attachment we have sent. This works well i= f I manually insert element by linking it with content-id. public void testDataHandler(Holder name, Holder attach= info) { if(attachinfo.value=3D=3Dnull) {System.out.println("attachinfo.value is nu= ll"); //This gets executed return;} InputStream mtomIn =3D attachinfo.value.getInputStream(); ByteArrayOutputStream out =3D new ByteArrayOutputStream(); and so on.... Also, in the below line we can use any random name to set content id. Isn't= it? att.setContentId(">"); Could you please help me out with this issue Below is the screenshot of my request in TCP mon - [cid:image001.jpg@01CF28AC.70954370] Regards, Alekhya From: Andrei Shakirin [mailto:ashakirin@talend.com] Sent: Monday, February 10, 2014 9:57 PM To: users@cxf.apache.org Cc: Gumudavelli, Alekhya Subject: RE: Query on CXF dispatch client with MTOM Hi, I do not think that you should add MTOM manually. It should be enough to activate MTOM and add attachment part in following w= ay: DataHandler dh1 =3D new DataHandler(new ByteArrayDataSource(bigByte= s, "text/plain")); AttachmentPart att =3D msg.createAttachmentPart(dh1); att.setContentId("= >"); msg.addAttachmentPart(att); See the testSwaTypesWithDispatchAPI() in https://svn.apache.org/repos/asf/c= xf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest= /swa/ClientServerSwaTest.java for details. Regards, Andrei. From: Gumudavelli, Alekhya [mailto:Alekhya.Gumudavelli@in.pega.com] Sent: Montag, 10. Februar 2014 08:36 To: Andrei Shakirin Cc: users@cxf.apache.org Subject: Query on CXF dispatch client with MTOM Hi Andrei, team I am writing a CXF client with MTOM by using dynamic dispatch style of serv= ice invocation. I understand that dynamic dispatch requires request message= to be constructed manually. But I would like to avoid manual insertion of XOP elemen= t in the SOAP message to enable MTOM. I am currently doing the following steps to generate a CXF mtom client 1. Enable MTOM using ((SOAPBinding)binding).setMTOMEnabled(true); 2. Construct SOAP request message programmatically SOAPMessage request =3D MessageFactory.newInstance().createMessage(); //create attachment and add it to request AttachmentPart attach =3D request.createAttachmentPart(new DataHandler(new = FileDataSource("F:\\CXF3\\CXF3\\src\\me.bmp"))); attach.setContentId("image"); request.addAttachmentPart(attach); SOAPElement operation =3D body.addChildElement("testDataHandler", "typ", "http://cxf.apache.org/mime/types"); /*Here, I am creating the SOAP body with appropriate nodes needed for MTOM = - The above request works well. However, manual inclusion of DOM elements lik= e this does not appear clean and maintainable. Could you tell me how else c= an we achieve this to generate the request dynamically? I have the same issue with SWA CXF dispatch client where I am including node programmatically which I want to avoid. Thanks, Alekhya Gumudavelli --_000_D225CD69196F3F4A9F4174B2FCA06F8811E8FA10S10BE002SH10lan_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,<= /p>

 

I got the issue now, s= orry for delay.

The problem is that if= you use WSDL or Java first approaches, you say CXF where inject a referenc= e to sending binary data:

-&n= bsp;         for WSDL using= <element name=3D"attachinfo" type=3D"xsd:base64Binary&qu= ot; xmime:expectedContentTypes=3D"application/octet-stream"/><= o:p>

-&n= bsp;         for java using= annotation:

  &nb= sp; @XmlMimeType("application/octet-stream")

  &nb= sp; protected DataHandler imageData;

 

In case of using Dispa= tch interface and SOAPMessage, user is responsible to build complete SOAP m= essage and, as a result, to insert <xop:Include href> element.

Currently CXF has no i= nformation where this element should be added in SOAPMessage body.

 

I think that could be = a useful extension to provide additional property for example in form of XP= ath and automate that for SOAPMessage as well.

Patch is welcome.=

 

Regards,

Andrei.

 

 

From: Gumudavelli, Alekhya [mailto:Alekhya.Gumudavelli@in.p= ega.com]
Sent: Dienstag, 18. Februar 2014 13:53
To: Andrei Shakirin; users@cxf.apache.org
Subject: RE: Query on CXF dispatch client with MTOM
Importance: High

 

Hi Andr= ei,

Any upd= ate on this. I raised a JIRA item on the same last week. Could someone plea= se look into it.

https://issues.apache.o= rg/jira/browse/CXF-5560

Let me = know if you need more details on the issue.

&n= bsp;

Regards= ,

Alekhya=

&n= bsp;

From: Gumudavelli, Alekhya
Sent: Thursday, February 13, 2014 11:42 AM
To: Andrei Shakirin; users@c= xf.apache.org
Subject: RE: Query on CXF dispatch client with MTOM

 

Hi,

 <= /span>

I am at= taching the client and service that I am using.  MTOMClient.java is a = standalone Java program that I wrote to connect to a service that I got fro= m CXF samples apache-cxf-3.0.0-milestone1.rar

( apach= e-cxf-3.0.0-milestone1\samples\mtom ).   links.txt is the file I = am trying to send as an MTOM attachment.

 <= /span>

I am al= so attaching MTOMClientBase64.java. It sends a base64 encoded data of the a= ttachment.

 <= /span>

Regards= ,

Alekhya=

 <= /span>

From: Andrei Shakirin [mailto:ashakirin@talend.com]
Sent: Wednesday, February 12, 2014 9:43 PM
To: users@cxf.apache.org=
Cc: Gumudavelli, Alekhya
Subject: RE: Query on CXF dispatch client with MTOM

 

Hi,

 

Interesting. Any chanc= e to create a small test case to reproduce that?

 

Regards,

Andrei.

 

From: Gumudavelli, Alekhya [= mailto:Alekhya.Gumudavelli= @in.pega.com]
Sent: Mittwoch, 12. Februar 2014 14:26
To: Andrei Shakirin;
us= ers@cxf.apache.org=
Subject: RE: Query on CXF dispatch client with MTOM

 

Hi,

I don&#= 8217;t find any difference between my client code and https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes/sy= stests/jaxws/src/test/java/org/apache/cxf/systest/swa/ClientServerSwaTest.j= ava except that I am doing an additional setting MTOMEnabled property to true.=

 <= /span>

Can you= give me any MTOM specific sample test (not just SWA). I would like to try = that out directly. I had searched in cxf/systest/ repository but could not = find any. I see that all MTOM tests in the repo use stubs and not dispatch API.

 <= /span>

Or can = you point me to the internal CXF code / class that takes care of adding <= ;xop include> element. I would like to debug and understand why is it no= t xop’ing it.

We are = revamping our entire stack to use CXF and this issue is hindering us from i= mplementing MTOM with CXF, one of the important features for clients.

 <= /span>

Thanks = much for the quick responses Andrei!

 <= /span>

Alekhya=

 <= /span>

From: Andrei Shakirin [mailto:ashakirin@talend.com]
Sent: Tuesday, February 11, 2014 11:06 PM
To:
users@cxf.apache.or= g
Cc: Gumudavelli, Alekhya
Subject: RE: Query on CXF dispatch client with MTOM

 

Hi,

 

It is quite difficult = to say what exactly wrong without your test case.

Could you run the syst= em test I referenced in last mail and try to find the difference between te= st and your code?

 

Regards,

Andrei.

 

From: Gumudavelli, Alekhya [= mailto:Alekhya.Gumudavelli= @in.pega.com]
Sent: Dienstag, 11. Februar 2014 12:54
To: Andrei Shakirin;
us= ers@cxf.apache.org=
Subject: RE: Query on CXF dispatch client with MTOM

 

Hi Andr= ei,

I am do= ing exactly the way you are referring. The service is not able to recognize= attachment.

 <= /span>

Below i= s my service method . It fails to process attachment as the parameter ̶= 0;attachinfo” does not hold the attachment we have sent. This works w= ell if I manually insert <attachinfo> element by linking it with content-id.=

 <= /span>

public = void testDataHandler(Holder<String> name, Holder<DataHandler>= ; attachinfo) {<= /o:p>

 &= nbsp;           &nbs= p;  if(attachinfo.value=3D=3Dnull)

           &nb= sp;             = ;       {System.out.println("attachin= fo.value is null");  //This gets executed

          &nbs= p;             =         return;}

 &= nbsp;           &nbs= p;  InputStream mtomIn =3D attachinfo.value.getInputStream();

 &= nbsp;            &nb= sp;ByteArrayOutputStream out =3D new ByteArrayOutputStream();

and so on….      =             &nb= sp;    

 

Also, i= n the below line we can use any random name to set content id. Isn’t = it?

 <= /span>      &nb= sp; att.setContentId("<attach1=3Dc187f5da-fa5d-4ab9= -81db-33c2bb855201@apache.org>");=

 

Could you please help = me out with this issue

 

 

Below is the screensho= t of my request in TCP mon –

 

3D"cid:image001.jpg@01CF28AC.70954370"

 

 

 <= /span>

Regards= ,

Alekhya=

 <= /span>

From: Andrei Shakirin [mailto:ashakirin@talend.com]
Sent: Monday, February 10, 2014 9:57 PM
To:
users@cxf.apache.or= g
Cc: Gumudavelli, Alekhya
Subject: RE: Query on CXF dispatch client with MTOM

 

Hi,

 

I do not think that yo= u should add MTOM <include> manually.

 

It should be enough to= activate MTOM and add attachment part in following way:

 

   &nbs= p;    DataHandler dh1 =3D new DataHandler(new ByteArrayDataS= ource(bigBytes, "text/plain"));

 

   &nbs= p;    AttachmentPart att =3D msg.createAttachmentPart(dh1);<= /span>

   &nbs= p;    att.setContentId("<attach1=3Dc= 187f5da-fa5d-4ab9-81db-33c2bb855201@apache.org>");

   &nbs= p;    msg.addAttachmentPart(att);

 

See the testSwaTypesWi= thDispatchAPI() in https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes/sy= stests/jaxws/src/test/java/org/apache/cxf/systest/swa/ClientServerSwaTest.j= ava for details.

 

Regards,

Andrei.

 

 

From: Gumudavelli, Alekhya [= mailto:Alekhya.Gumudavelli= @in.pega.com]
Sent: Montag, 10. Februar 2014 08:36
To: Andrei Shakirin
Cc:
users@cxf.apache.or= g
Subject: Query on CXF dispatch client with MTOM

 

Hi Andrei= , team

 

I am writ= ing a CXF client with MTOM by using dynamic dispatch style of service invoc= ation. I understand that dynamic dispatch requires request message to be co= nstructed manually.

But I wou= ld like to avoid manual insertion of <inc:include href> XOP element i= n the SOAP message to enable MTOM.

 

I am curr= ently doing the following steps to generate a CXF mtom client

1.       Enable MTOM using

 

((SOAPBinding)binding).setMTOMEnabled();

 

2.       Construct SOAP request me= ssage programmatically

 

SOAPMessage request =3D = MessageFactory.newInstance().createMessage();

//= create attachment and add it to request

AttachmentPart attach =3D request.createAttachmentPart(new DataHandler(new FileDataSource("F:\\CXF3\\CXF3\\s= rc\\me.bmp")));

&= nbsp;     attach.setContentId(= "image");

request.addAttachmentPar= t(attach);

 

SOAPElement operation =3D body.addChildElement("testDataHandler"= , "typ",<= /span>

&= nbsp;          "<= span style=3D"font-size:10.0pt;font-family:"Courier New"">http://= cxf.apache.org/mime/types");

&= nbsp;

/= *Here, I am creating the SOAP body with appropriate nodes needed for MTOM -= <inc:include href=3D”image”. . . */

 <= /span>

SOAPElement value1 =3D operation.addChildElement("attachinfo",= "tns","http://cxf.apache.org/mime/types");

SOAPElement xop =3D= value1.addChildElement("Include","inc","http://www.w3.org/2004/08/= xop/include");<= /b>

xop.addAttribute(QN= ame.valueOf("href"),"cid:image<= /a>");

 

Generated request message :

<soap:= Envelope xmlns:soap=3D"http://schemas.xmlsoap.org/soap/envelope/"= ; xmlns:typ=3D"http://cxf.apache.org/mime/types">

 &nb= sp; <soapenv:Header xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/e= nvelope/"/>

 &nb= sp; <soap:Body>

 &nb= sp; <typ:testDataHandler>

<tns:attachinfo xmlns:tns=3D"= htt= p://cxf.apache.org/mime/types"><inc:Include xmlns:inc=3D"http://www.w3.org/2004/08/xop/include" href=3D"cid:image"/>= </= tns:attachinfo= >

</typ:testDataHandler>

</soap= :Body>

</soap= :Envelope>

 

The above= request works well. However, manual inclusion of DOM elements like this do= es not appear clean and maintainable. Could you tell me how else can we ach= ieve this to generate the request d= ynamically?

 <= /span>

I have th= e same issue with SWA CXF dispatch client where I am including <cid:image> node programmatically which I want to avoi= d.

 <= /span>

Thanks,

Alekhya G= umudavelli

 

 

 

--_000_D225CD69196F3F4A9F4174B2FCA06F8811E8FA10S10BE002SH10lan_-- --_004_D225CD69196F3F4A9F4174B2FCA06F8811E8FA10S10BE002SH10lan_--