> From my skeleton impl:
> FileOutputStream fos = new FileOutputStream(file);
> "MTOMrequest.getDataHandler()".writeTo(fos);
> So what happens here, will I actually be writing the data to disk a
second
> time?
In this case yes,
Yes... If your use case is to save the attachment to a file, then you
can directly access the cached file and move it to the appropriate
location..
           DataHandler dataHandler = MTOMrequest.getDataHandler()
           DataSource dataSource=dataHandler.getDataSource();
         // For added safety.. You can get rid of this if you specify
the caching threshold as 0.
           if (dataSource instanceof FileDataSource) {
               FileDataSource fileDataSource = (FileDataSource) dataSource;
               File file =fileDataSource.getFile();
           }

it would be a bad idea having enabled the file-cache
in axis2.xml.
You can specify a larger threshold for file caching to avoid smaller
attachments getting cached..  You can disable caching If you are not
planning to receive large attachments..But the danger is you would get
a outofmemory if you receive a larger one in case. ...

Thanks,
Thilina



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Thilina Gunarathne  -  http://www.wso2.com - http://thilinag.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to