axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Subhendu Kumar mohanty" <subhend...@infosys.com>
Subject RE: Axis attachment file created in the Temp directory
Date Mon, 14 Jul 2003 21:38:58 GMT
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:webmaster@blis-project.org]
Sent: Monday, July 14, 2003 5:27 PM
To: axis-user@ws.apache.org
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:webmaster@blis-project.org]
>Sent: Monday, July 14, 2003 2:32 PM
>To: axis-user@ws.apache.org
>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
>> 
>>
>>    
>>
>
>  
>



Mime
View raw message