Hi,
When I receive a SOAP with attachments, the attachments get instantiated using
ManagedMemoryDataSource. When one of my handlers in the chain serializes this message
"msg" by
calling msg.writeTo(ostream), this in turn calls AttachmentsImpl's
writeContentToStream(ostream) and the following code fragment in this method:
...
DataSource ds = dh.getDataSource();
if ((ds != null) && (ds instanceof ManagedMemoryDataSource)) {
((ManagedMemoryDataSource) ds).delete();
}
...
deletes the objects associated with the attachments.
So, when I try to serialize the message again by calling the same method, I get
java.io.IOException: Resource has been deleted.
My question is how to avoid this problem. I can think of several possibilities:
- Can I make DataHandlerDataSource be used instead of ManagedMemoryDataSource?
- Can I use my local AttachmentsImpl that comments out the above delete line? I tried
this in several ways: first setting the attachments.implementation parameter in the
deployment descriptor, second setting the engine's option parameter
AxisEngine.DEFAULT_ATTACHMENT_IMPL. None worked because my Call.invoke(data) calls
Message.isAttachemntSupportEnabled() early when the message context is still null,
which causes this method to pick the hardcoded implementation name and not the one you
set using AxisEngine.DEFAULT_ATTACHMENT_IMPL.
I am using Axis Version 1.1.
Any help will be appreciated.
Thank you.
Aki Yoshida