Just as i suspected....There's NOTHING special you need to do. See enclosed code all 
you need to
do is to feed the inputstream of the data handler into ZipInputStream. Axis hides 
actual DIME
stuff.

            AttachmentPart ap = (AttachmentPart) iterator.next();
            DataHandler rdh = (DataHandler) ap.getDataHandler();
                                
            ZipInputStream zis = new ZipInputStream(rdh.getInputStream());
            ZipEntry entry = null;
            while((entry = zis.getNextEntry())!=null) {
                System.out.println("eerste zipfile entry: " + entry.getName());
            }

-- dims


--- Leo de Blaauw <[EMAIL PROTECTED]> wrote:
> Dims,
> 
> This is basically a .NET client, we have the webservice wich is being
> developed in axis. The reference
> to the attachment is not in the WSDL describing the service. We basically
> get to the attachment trough
> the use of:
> 
> Attachmentpart.getAttachmentFile());
> (DataHandler) Attachmentpart.getDataHandler();
> 
> After wich we can get to the actual attachment itself, problem now is that
> the attachment is of
> application/dime type. 
> 
> My fundamental question is really how to get to the contents of the dime
> attachment, wich is 
> basically a wrapper. In the dime attachment is a zipfile wich in need to
> unpack and then process
> in our backend systems...
> 
> After getting the workaround for the cleaning up of the axis attachments
> cache, this is the next
> challenge i guess.
> 
> I can't really imagine no one ever stumbled on this issue ??? 
> 
> The library i tried using to get to the contents of the dime object is:
> com.onionnetworks.dime wich is a java based library for dime processing,
> however it supports
> version 1 chunked or non-chunked DIME only. When trying to parse a dime
> message, generated
> by axis to the same service i get the error stating that the dime version
> axis is using is different
> from 1.0 ??
> 
> Anyway, thanks for your help in this issue !
> 
> Sincere greetings,
> Leo de Blaauw
> 
> 
> -----Oorspronkelijk bericht-----
> Van: Davanum Srinivas [mailto:[EMAIL PROTECTED]
> Verzonden: woensdag, juli 2003 15:35
> Aan: [EMAIL PROTECTED]
> Onderwerp: RE: Dime parsing example ??
> 
> 
> Do you have an existing .NET Web Service that does this? Is there a WSDL for
> this service?
> 
> Thanks,
> dims
> 
> --- Leo de Blaauw <[EMAIL PROTECTED]> wrote:
> > Well,
> > 
> > Yeah i know that example but that just reads in the DIME attachment and
> > copies it over to the
> > reply message without touching the contents at all.. So again not really
> > answered my question
> > unfortunatly... I found an open source java library that deals with DIME
> > objects but it comes
> > back with the message it doesnt support the DIME version axis uses...
> > 
> > Sincere greetings,
> > Leo de Blaauw
> > 
> > -----Oorspronkelijk bericht-----
> > Van: Davanum Srinivas [mailto:[EMAIL PROTECTED]
> > Verzonden: woensdag, juli 2003 15:14
> > Aan: [EMAIL PROTECTED]
> > Onderwerp: RE: Dime parsing example ??
> > 
> > 
> > look at samples/attachments...It has a Echo Attachments service that can
> > also do DIME. 
> > 
> > -- dims
> > 
> > --- Leo de Blaauw <[EMAIL PROTECTED]> wrote:
> > > Well,
> > > 
> > > Quick answer but doesnt really answer any of my questions ;-(
> > > 
> > > Greetings,
> > > Leo de Blaauw
> > > 
> > > -----Oorspronkelijk bericht-----
> > > Van: Kellogg, Richard [mailto:[EMAIL PROTECTED]
> > > Verzonden: woensdag, juli 2003 15:07
> > > Aan: [EMAIL PROTECTED]
> > > Onderwerp: RE: Dime parsing example ??
> > > 
> > > 
> > > Please refer to
> > >
> >
> http://nagoya.apache.org/wiki/apachewiki.cgi?AxisProjectPages/DotNetInterop.
> > > 
> > > -----Original Message-----
> > > From: Leo de Blaauw [mailto:[EMAIL PROTECTED]
> > > Sent: Wednesday, July 23, 2003 9:03 AM
> > > To: [EMAIL PROTECTED] Apache. Org (E-mail)
> > > Subject: Dime parsing example ??
> > > 
> > > 
> > > Hi,
> > > 
> > > Does anybody have a working example of how to get to the files (parts)
> IN
> > a
> > > dime
> > > attachment ? I have been having the hardes time just get a zip file from
> a
> > > DIME 
> > > attachment.
> > > 
> > > Also wich version of DIME does axis support currently ? Basically my
> > service
> > > has
> > > to service .net clients sending in requests with DIME attachments
> > containing
> > > zip
> > > files..
> > > 
> > > Any help or pointers greatly appreciated !
> > > 
> > > Sincere greetz
> > > Leo de Blaauw
> > > 
> > > 
> > > 
> > > 
> > > De informatie verzonden met dit e-mail bericht is uitsluitend bestemd
> voor
> > > de 
> > > geadresseerde. Openbaarmaking, vermenigvuldiging, verspreiding en/of
> > > verstrekking 
> > > van deze informatie aan derden is niet toegestaan.  Indien dit bericht
> > niet
> > > voor u 
> > > bestemd is, verzoeken wij u vriendelijk dit bericht te retourneren zodat
> > dit
> > > in de 
> > > toekomst kan worden voorkomen. Ondanks het feit dat IZA Nederland al
> haar
> > > e-mail 
> > > berichten controleert op virussen, staat zij niet in voor het virusvrij
> > > verzenden c.q. 
> > > ontvangen van deze berichten.
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > De informatie verzonden met dit e-mail bericht is uitsluitend bestemd
> voor
> > de 
> > > geadresseerde. Openbaarmaking, vermenigvuldiging, verspreiding en/of
> > verstrekking 
> > > van deze informatie aan derden is niet toegestaan.  Indien dit bericht
> > niet voor u 
> > > bestemd is, verzoeken wij u vriendelijk dit bericht te retourneren zodat
> > dit in de 
> > > toekomst kan worden voorkomen. Ondanks het feit dat IZA Nederland al
> haar
> > e-mail 
> > > berichten controleert op virussen, staat zij niet in voor het virusvrij
> > verzenden c.q. 
> > > ontvangen van deze berichten.
> > > 
> > 
> > 
> > =====
> > Davanum Srinivas - http://webservices.apache.org/~dims/
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free, easy-to-use web site design software
> > http://sitebuilder.yahoo.com
> > 
> > 
> > 
> > 
> > De informatie verzonden met dit e-mail bericht is uitsluitend bestemd voor
> de 
> > geadresseerde. Openbaarmaking, vermenigvuldiging, verspreiding en/of
> verstrekking 
> > van deze informatie aan derden is niet toegestaan.  Indien dit bericht
> niet voor u 
> > bestemd is, verzoeken wij u vriendelijk dit bericht te retourneren zodat
> dit in de 
> > toekomst kan worden voorkomen. Ondanks het feit dat IZA Nederland al haar
> e-mail 
> > berichten controleert op virussen, staat zij niet in voor het virusvrij
> verzenden c.q. 
> > ontvangen van deze berichten.
> 
=== message truncated ===

=====
Davanum Srinivas - http://webservices.apache.org/~dims/

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
import _63._16._16._172.axis.services.Echo.EchoServiceLocator;
import _63._16._16._172.axis.services.Echo.EchoSoapBindingStub;

import javax.activation.DataHandler;
import javax.activation.FileDataSource;

import org.apache.axis.client.Call;

/**
 * Created by IntelliJ IDEA.
 * User: srida01
 * Date: Jul 23, 2003
 * Time: 10:52:31 AM
 * To change this template use Options | File Templates.
 */
public class TestClient {
    public static void main(String[] args) throws Exception {
        EchoServiceLocator locator = new EchoServiceLocator();
        EchoSoapBindingStub stub = (EchoSoapBindingStub)locator.getEcho();
        ((org.apache.axis.client.Stub)stub)._setProperty(Call.ATTACHMENT_ENCAPSULATION_FORMAT, Call.ATTACHMENT_ENCAPSULATION_FORMAT_DIME);
        DataHandler dh = new DataHandler(new FileDataSource(args[0]));
        stub.addAttachment(dh);
        System.out.println(stub.echo("XXX"));
    }
}
package samples.echo;

import org.apache.axis.MessageContext;
import org.apache.axis.Message;
import org.apache.axis.description.OperationDesc;
import org.apache.axis.components.logger.LogFactory;
import org.apache.axis.attachments.AttachmentPart;
import org.apache.axis.attachments.ManagedMemoryDataSource;
import org.apache.axis.attachments.Attachments;
import org.apache.commons.logging.Log;

import javax.activation.DataHandler;
import javax.activation.DataSource;
import java.io.InputStream;
import java.io.BufferedInputStream;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipEntry;
import java.util.Iterator;

/**
 * Created by IntelliJ IDEA.
 * User: srida01
 * Date: Jul 23, 2003
 * Time: 10:47:57 AM
 * To change this template use Options | File Templates.
 */
public class Echo {
    
    public String echo(String x) {
        
        MessageContext msgContext = MessageContext.getCurrentContext();
        Message reqMsg = msgContext.getCurrentMessage();
        Attachments attachments = reqMsg.getAttachmentsImpl();
        	
        //eigenlijk overbodige check hieronder, daar vecozo alleen aanroept met
        //attachments...
        if(null == attachments){
            System.out.println("Geen attachments bij bericht");
            //geen axisfault throwen daar deze terug gaan naar vecozo !
        } else {
            System.out.println("Attachments gevonden in bericht");
            System.out.println("getSend Type: " + attachments.getSendType());
        }
        	
        try{
        Iterator iterator = (attachments.getAttachments()).iterator();
        if(!iterator.hasNext()){
            System.out.println("Onjuiste attachments gevonden");	
        }
        		
            AttachmentPart ap = (AttachmentPart) iterator.next();
            DataHandler rdh = (DataHandler) ap.getDataHandler();
				
            InputStream ip = rdh.getInputStream();
            System.out.println("Input stream: " + ip);
            BufferedInputStream bis = new BufferedInputStream(ip);
            System.out.println("aantal bytes: "+ bis.available());
            String receivedfileName = rdh.getName();
            if(receivedfileName == null){
                System.out.println("Geen file naam gevonden..");
            }
            System.out.println("File: " + receivedfileName);
            //content-type below will be application/dime
            System.out.println("Content-type: " + rdh.getContentType());
            //trying DIME parsing fails on dime version not being 1.0
            //when sending our service a message from an axis client
            //not possible to test with .net client at this time....
            ZipInputStream zis = new ZipInputStream(rdh.getInputStream());
            ZipEntry entry = null;
            while((entry = zis.getNextEntry())!=null) {
                System.out.println("eerste zipfile entry: " + entry.getName());
            }
            //todo mapping
				
            //\mapping
            //zis.close(); 
            bis.close();
            ip.close();
            ap.dispose();
				
            //handmatig opruimen axis attachment directory
            DataSource ds= rdh.getDataSource();
            if(ds instanceof ManagedMemoryDataSource ){
                  ((ManagedMemoryDataSource )ds).delete(); 
            }
    			
        } catch (Exception e){
            //aangezien vecozo niet voorziet in foutcodes tbv deze
            //service alle exceptions die optreden hier loggen plus de
            //stacktrace.
				
            System.out.println("Exception in declaren: " + e.toString());
            e.printStackTrace();
        }
        
        return x;
    }
}

Attachment: deploy.wsdd
Description: deploy.wsdd

Reply via email to