Ideally Axis can clean it up once the request is serviced.

How about using cron job to clean up temprary files that are older than say
30 minutes.



                                                                                       
                                            
                      "Subhendu Kumar                                                  
                                            
                      mohanty"                 To:      <[EMAIL PROTECTED]>            
                                      
                      <[EMAIL PROTECTED]         cc:                                   
                                              
                      sys.com>                 Subject: RE: Axis attachment file 
created in the Temp directory                     
                                                                                       
                                            
                      07/14/2003 05:38                                                 
                                            
                      PM                                                               
                                            
                      Please respond                                                   
                                            
                      to axis-user                                                     
                                            
                                                                                       
                                            
                                                                                       
                                            




NO.

ManagedMemoryDataSource class of Axis creates temporary files in the file
system when we receive the image as attachment and is not deleted .


Thanks,
Subhendu

-----Original Message-----
From: BLIS Webmaster (Patrick Houbaux)
[mailto:[EMAIL PROTECTED]
Sent: Monday, July 14, 2003 5:27 PM
To: [EMAIL PROTECTED]
Subject: Re: Axis attachment file created in the Temp directory



In the following the SOAPTest service exposes a method testAttachement
that send a SOAP message with attachement.
The following client call that method, takes the part and delete the
file. I don't know if it is what you want but it works fine.



    public static void main(String [] args) {
        try {
            String endpoint =
"http://localhost:8080/axis/services/SOAPTest?wsdl";;

            Service  service = new Service();
            Call     call    = (Call) service.createCall();

            java.net.URL url = new java.net.URL(endpoint);
            call.setTargetEndpointAddress(url);

            call.setOperationName("testAttachement");
            call.setMaintainSession(true);

            String ret = (String)call.invoke(new Object[]{});

            org.apache.axis.Message rspMsg= call.getResponseMessage();
            java.util.Iterator iter = rspMsg.getAttachments();
            while (iter.hasNext()){
                org.apache.axis.attachments.AttachmentPart part =
(org.apache.axis.attachments.AttachmentPart)iter.next();
                java.io.File file = new
java.io.File(part.getDataHandler().getName());

                //
                // Do something with the file
                //

                file.delete();
            }
        } catch (Exception e) {
            System.err.println(e.toString());
            e.printStackTrace();
        }
    }


Cheers,
Patrick.


Subhendu Kumar mohanty wrote:

>Even if I can not change the directory .
>
>What will happen if the job is deleting when somebody is requesting for
the image.
>
>Is this a limitation of using data handler for attachment in the client
side ?
>
>Thanks,
>Subhendu
>
>-----Original Message-----
>From: BLIS Webmaster (Patrick Houbaux)
>[mailto:[EMAIL PROTECTED]
>Sent: Monday, July 14, 2003 2:32 PM
>To: [EMAIL PROTECTED]
>Subject: Re: Axis attachment file created in the Temp directory
>
>
>I guess you have to clean it or move it somewhere else in your client
code.
>
>Patrick.
>
>Subhendu Kumar mohanty wrote:
>
>
>
>>Hi all,
>>
>>I am developing a webservice client which uses Axis. My client app calls
an external webservice to get the image.I found that Axis creates temporary
files in the system default temporary directory and does not clean up.
>>
>>If anybody has solved this problem please let me know.
>>
>>Thanks,
>>Subhendu
>>
>>
>>
>>
>
>
>







Reply via email to