Currently i'am migrating from Spring WS 4.x to 5.x. Within one of our test an MTOM Soap message is send to a camel servlet with a spring ws endpoint. Within the endpoint a bean is called that reads the attachments from the exchange.
This was previously working with Axiom 1.2 but is no longer working on Axiom 1.4. The reason for the problem is that the attachments are already read and reading it for the second time results in a illegalstateexception (MemoryBlobImpl).
Within the servlet the 'soap message' is translated to an Axiom soap object model and after that translation the attachments are added in the camel exchange. Within the translation of the soap message (BuilderSpec#from) the attachments are read with a preserve 'false' value which result in the memory blob content being discarded.
May be i'am doing something wrong but i can't see a solution how to consume a Axiom Soap MEssage with MTOM.
does anyone has an example or does anyone know a unit test where this situation is tested.
Thanx,
Richard
Additional information after the first question
Sending the message
Within the message filter the soapmessage#setOptimized is called
Receiving the message The receiving part is also done within Apache Camel which delivers the information to a bean. Within the bean the following is done:
Map<String, DataHandler> receivedAttachments = exchange.getIn(AttachmentMessage.class).getAttachments(); and later on the dataHandler#getInpustream is read. But this results in a illegalstateexception from the MemoryBlobImpl.