Hi, I'm writing a web service using Axis2 that passes back binary data on the response. Inside my service I achieve this by creating a DataHandler corresponding to the File I want to return, then add in some OMText to the response by calling OMFactory.createOMText(Object, boolean).
My Service is implemented to extend LifeCycle, so that after the message is sent I can delete the file that the File object represents (deleting it earlier doesn't work because it is only read in once I return to Axis2). However that means I'm waiting until the HTTP session is closed before deleting the file, which I'd prefer not to do. What I'd really like to do is have some sort of callback as soon as the message is sent (at which point I'm safe to delete the file). Any ideas? If not then I'll look into forcing the binary data to be read in to the response inside my service, so that I can delete the file straight away, but I'd prefer not to do that if there's a clever way round it. Oh, and while I'm on - thanks to the Axis team for all your hard work. It's much appreciated! Ken
