Skip to main content

JAX-WS, MTOM and temporary files

1 reply [Last post]
malm
Offline
Joined: 2006-05-29
Points: 0

I need to send a temporary file via a webservice. I set it up to use MTOM and set a DataSource on the relevant element. Problem is, how can I reliably find out that JAX-WS is done with using the DataSource so I can delete the file? I tried a custom DataSource which calls delete on the file when close() is called on the InputStream it returns but that doesn't work as JAX-WS seems to call the getInputStream() method more than once (probably because I do some logging and/or have outgoing request validation enabled). Any way, that seems more like a hack in the first place. So, what is the correct method to find out that JAX-WS is done with a particular request/response so resources the application has allocated for it can be released?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alph486
Offline
Joined: 2012-04-24
Points: 0

Hi Malm,

On the off chance you're still around on here... Did you ever find a solution to this problem? I've seen some off the wall... hacky ones, but looking for a more direct answer.

Thanks