Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 5608 invoked from network); 5 Oct 2009 07:35:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Oct 2009 07:35:22 -0000 Received: (qmail 96636 invoked by uid 500); 5 Oct 2009 07:35:21 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 96402 invoked by uid 500); 5 Oct 2009 07:35:20 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 96387 invoked by uid 99); 5 Oct 2009 07:35:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Oct 2009 07:35:20 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of andreas.veithen@gmail.com designates 209.85.218.221 as permitted sender) Received: from [209.85.218.221] (HELO mail-bw0-f221.google.com) (209.85.218.221) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Oct 2009 07:35:08 +0000 Received: by bwz21 with SMTP id 21so2121722bwz.16 for ; Mon, 05 Oct 2009 00:34:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=EbyQEUrQsEH0/IoLAU9As9plBb0sNzbcRvpEvonZ0jU=; b=VxVZvnVUGigUqsDxdrw11JMv580jfNietSLxTOynygaLjqquHc3zPGfiCb5iq0SqTQ uJt2ZW/6EZsieUBvyD3CEOk4wrVLxIxTIGVQ5epWYMZj2gSHpkZNxxEOHmL8+W6uKSDT UWnTfIs8YnwRV8Z1+JN/1G1CRrKIh5WjYMo00= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=tswGMyXKFkLLFd5xbn+6PVZHpj0R5pbh+wTNELuXfeb/6kTxUzU4X+pfLYlOiLyUMo yuTNvB75VCVDk5vvL6zdkmxJxh8YhfWfOLTetyQAnqhTjbNL2CxwvrUWn9K1jkeYK5gf enOh22BhgTauf6+qXWLsMOLbmjk0YNPhTI+DY= MIME-Version: 1.0 Received: by 10.239.143.214 with SMTP id l22mr476081hba.167.1254728088096; Mon, 05 Oct 2009 00:34:48 -0700 (PDT) In-Reply-To: <8a8d77970910032158k2eee15fr4bd21b16f1e8ee25@mail.gmail.com> References: <60708f4b0909010527p4a9d4462y8240458774274924@mail.gmail.com> <60708f4b0909022051x6c82a047m878f6e9cfa586412@mail.gmail.com> <8a8d77970909220449k229c131fy21b6d495b53f402d@mail.gmail.com> <8a8d77970910032158k2eee15fr4bd21b16f1e8ee25@mail.gmail.com> From: Andreas Veithen Date: Mon, 5 Oct 2009 09:34:28 +0200 Message-ID: Subject: Re: MTOM is not working with Axis2 trunk To: commons-dev@ws.apache.org Cc: axis-dev@ws.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org I will try to free up some time tonight to do a debugging session. Andreas On Sun, Oct 4, 2009 at 06:58, Senaka Fernando wrote: > Folks, > > We need to get this fixed on Axis2. Andreas, do you have any idea to what > could be causing this issue? > > Thanks, > Senaka. > > On Tue, Sep 22, 2009 at 5:19 PM, Senaka Fernando wrote: > >> Hi Andreas, >> >> Have you tested this with Axis2 deployed as a webapp? MTOM seems to work >> fine with the SimpleAxisServer but not when Axis2 is deployed as a webap= p. >> Below is what I observed on TCPMon (first response is from the >> SimpleAxisServer). >> >> ------------------------------------------------------------------------ >> HTTP/1.1 200 OK >> Date: Mon, 21 Sep 2009 19:03:14 GMT >> Server: Simple-Server/1.1 >> Transfer-Encoding: chunked >> Content-Type: multipart/related; >> boundary=3DMIMEBoundaryurn_uuid_9645FCE52FDC6F4D931253559793956; >> type=3D"application/xop+xml"; start=3D"< >> 0.urn:uuid:9645FCE52FDC6F4D931253559793957@apache.org<0.urn%3Auuid%3A964= 5FCE52FDC6F4D931253559793957@apache.org>>"; >> start-info=3D"text/xml" >> >> 202 >> --MIMEBoundaryurn_uuid_9645FCE52FDC6F4D931253559793956 >> Content-Type: application/xop+xml; charset=3DUTF-8; type=3D"text/xml" >> Content-Transfer-Encoding: binary >> Content-ID: <0.urn:uuid:9645FCE52FDC6F4D931253559793957@apache.org<0.urn= %3Auuid%3A9645FCE52FDC6F4D931253559793957@apache.org>> >> >> >> > http://schemas.xmlsoap.org/soap/envelope/">> xmlns:ns2=3D"http://ws.apache.org/axis2/mtomsample/">File saved >> succesfully. >> 3c >> >> --MIMEBoundaryurn_uuid_9645FCE52FDC6F4D931253559793956-- >> >> 0 >> ------------------------------------------------------------------------ >> HTTP/1.1 200 OK >> Server: Apache-Coyote/1.1 >> Content-Type: multipart/related; >> boundary=3DMIMEBoundaryurn_uuid_9E87539EB4CACBEB921253619434971; >> type=3D"application/xop+xml"; start=3D"< >> 0.urn:uuid:9E87539EB4CACBEB921253619434972@apache.org<0.urn%3Auuid%3A9E8= 7539EB4CACBEB921253619434972@apache.org>>"; >> start-info=3D"text/xml" >> Transfer-Encoding: chunked >> Date: Tue, 22 Sep 2009 11:37:15 GMT >> >> 202 >> --MIMEBoundaryurn_uuid_9E87539EB4CACBEB921253619434971 >> Content-Type: application/xop+xml; charset=3DUTF-8; type=3D"text/xml" >> Content-Transfer-Encoding: binary >> Content-ID: <0.urn:uuid:9E87539EB4CACBEB921253619434972@apache.org<0.urn= %3Auuid%3A9E87539EB4CACBEB921253619434972@apache.org>> >> >> >> > http://schemas.xmlsoap.org/soap/envelope/">> xmlns:ns2=3D"http://ws.apache.org/axis2/mtomsample/">File saved >> succesfully. >> 0 >> ----------------------------------------------------------------------- >> >> Thanks, >> Senaka. >> >> >> On Thu, Sep 3, 2009 at 1:05 PM, Andreas Veithen > > wrote: >> >>> On Thu, Sep 3, 2009 at 05:51, Amila >>> Suriarachchi wrote: >>> > On Thu, Sep 3, 2009 at 3:16 AM, Andreas Veithen >>> > wrote: >>> > >>> >> Hi Amila, >>> >> >>> >> I implemented a service and a client according to your description, >>> >> but I'm unable to reproduce the issue. Any idea if this is a problem >>> >> at client side or in the server? >>> >> >>> > >>> > you mean you get exactly the same file size after being transfered by >>> MTOM? >>> > Hope you have tested >>> > with few binary files with different file sizes. >>> >>> Yes, I tested with different files with sizes ranging from a couple of >>> KB to several MB. They all got transferred correctly. >>> >>> > since there is no exception I have no idea about where could be the >>> problem >>> > is. Can the os be a problem? >>> > I am using Ubuntu linux. >>> >>> It could be some subtle problem depending on the OS (I tested on Mac >>> OS X), the JRE (I tested on Apple/Sun Java 1.5) or the JARs in the >>> classpath (On the client side, I tested with activation and javamail >>> from Geronimo and Sun, but there is no difference). >>> >>> > thanks, >>> > Amila. >>> > >>> > >>> >> Andreas >>> >> >>> >> On Tue, Sep 1, 2009 at 14:27, Amila >>> >> Suriarachchi wrote: >>> >> > hi, >>> >> > I tested the MTOM with the Axis2 trunk with the following service >>> >> > >>> >> > =A0public String sendFile(DataHandler dataHandler){ >>> >> > =A0 =A0 =A0 =A0try { >>> >> > =A0 =A0 =A0 =A0 =A0 =A0FileOutputStream fileOutputStream =3D new >>> >> > FileOutputStream("/home/amila/ec2-bak.tgz"); >>> >> > =A0 =A0 =A0 =A0 =A0 =A0dataHandler.writeTo(fileOutputStream); >>> >> > =A0 =A0 =A0 =A0 =A0 =A0fileOutputStream.flush(); >>> >> > =A0 =A0 =A0 =A0 =A0 =A0fileOutputStream.close(); >>> >> > =A0 =A0 =A0 =A0 =A0 =A0System.out.println("finish writting"); >>> >> > =A0 =A0 =A0 =A0} catch (FileNotFoundException e) { >>> >> > =A0 =A0 =A0 =A0 =A0 =A0e.printStackTrace(); >>> >> > =A0 =A0 =A0 =A0} catch (IOException e) { >>> >> > =A0 =A0 =A0 =A0 =A0 =A0e.printStackTrace(); >>> >> > =A0 =A0 =A0 =A0} >>> >> > =A0 =A0 =A0 =A0return "ok"; >>> >> > =A0 =A0} >>> >> > >>> >> > with the service.xml to deploy >>> >> > >>> >> > >>> >> > =A0 =A0 =A0 =A0>> >> > elementFormDefaultQualified=3D"false"/> >>> >> > =A0 =A0 =A0 =A0 >>> >> > =A0 =A0 =A0 =A0 =A0 =A0>> http://www.w3.org/2004/08/wsdl/in-only" >>> >> > >>> >> > class=3D"org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/= > >>> >> > =A0 =A0 =A0 =A0 =A0 =A0>> http://www.w3.org/2004/08/wsdl/in-out" >>> >> > >>> >> > class=3D"org.apache.axis2.rpc.receivers.RPCMessageReceiver"/> >>> >> > =A0 =A0 =A0 =A0 >>> >> > =A0 =A0 =A0 =A0>> >> > name=3D"ServiceClass">test.lockhead.service.MTOMService >>> >> > =A0 =A0 >>> >> > >>> >> > Then I generate the code for this service with ADB and access it w= ith >>> the >>> >> > following client >>> >> > >>> >> > private void testMTOM(){ >>> >> > =A0 =A0 =A0 =A0try { >>> >> > =A0 =A0 =A0 =A0 =A0 =A0MTOMServiceStub mtomServiceStub =3D new MTO= MServiceStub(" >>> >> > >>> >> >>> http://localhost:8080/axis2/services/MTOMService.MTOMServiceHttpSoap12E= ndpoint/ >>> >> " >>> >> > ); >>> >> > >>> >> > >>> >> > >>> >> >>> mtomServiceStub._getServiceClient().getOptions().setProperty(Constants.= Configuration.ENABLE_MTOM, >>> >> > Constants.VALUE_TRUE); >>> >> > =A0 =A0 =A0 =A0 =A0 =A0DataSource dataSource =3D new >>> >> > FileDataSource("/home/amila/ec2.tgz"); >>> >> > =A0 =A0 =A0 =A0 =A0 =A0DataHandler dataHandler =3D new DataHandler= (dataSource); >>> >> > >>> >> > =A0 =A0 =A0 =A0 =A0 =A0mtomServiceStub.sendFile(dataHandler); >>> >> > =A0 =A0 =A0 =A0} catch (AxisFault axisFault) { >>> >> > =A0 =A0 =A0 =A0 =A0 =A0axisFault.printStackTrace(); >>> >> > =A0 =A0 =A0 =A0} catch (java.rmi.RemoteException e) { >>> >> > =A0 =A0 =A0 =A0 =A0 =A0e.printStackTrace(); >>> >> > =A0 =A0 =A0 =A0} >>> >> > =A0 =A0} >>> >> > >>> >> > every thing worked fine. Then I went the command prompt and compar= e >>> the >>> >> > sizes of the files >>> >> > >>> >> > amila@amila:~$ ls -all ec2-bak.tgz ec2.tgz >>> >> > -rw-r--r-- 1 amila amila 1990 2009-09-01 17:39 ec2-bak.tgz >>> >> > -rw-r--r-- 1 amila amila 2864 2009-09-01 17:28 ec2.tgz >>> >> > amila@amila:~$ tar -xvf ec2-bak.tgz >>> >> > >>> >> > gzip: stdin: invalid compressed data--format violated >>> >> > tar: Child returned status 1 >>> >> > tar: Error exit delayed from previous errors >>> >> > >>> >> > so file has not transfered correctly. >>> >> > >>> >> > Now if I switch off the MTOM by commenting that line >>> >> > >>> >> > amila@amila:~$ ls -all ec2-bak.tgz ec2.tgz >>> >> > -rw-r--r-- 1 amila amila 2864 2009-09-01 17:53 ec2-bak.tgz >>> >> > -rw-r--r-- 1 amila amila 2864 2009-09-01 17:28 ec2.tgz >>> >> > amila@amila:~$ tar -xvf ec2-bak.tgz >>> >> > .ec2/ >>> >> > .ec2/accno >>> >> > .ec2/cert-76TWWMUYTIAS5B7JK73C2FNCQ5R52CBO.pem >>> >> > .ec2/debian_public_debian_etch_15Sep07-keypair >>> >> > .ec2/pk-76TWWMUYTIAS5B7JK73C2FNCQ5R52CBO.pem >>> >> > >>> >> > it works fine. >>> >> > >>> >> > thanks, >>> >> > Amila. >>> >> > >>> >> > >>> >> > >>> >> > -- >>> >> > Amila Suriarachchi >>> >> > WSO2 Inc. >>> >> > blog: http://amilachinthaka.blogspot.com/ >>> >> > >>> >> >>> > >>> > >>> > >>> > -- >>> > Amila Suriarachchi >>> > WSO2 Inc. >>> > blog: http://amilachinthaka.blogspot.com/ >>> > >>> >> >> >