Currently, it is not possible to add attachments using jaxws's attachments.
There are some options to get the wiring of attachments (of cxf and jaxws) working.
change the WrappedMessageContext's put method so that the cxf's native attachments-set gets added when the jaxws attachments-map is added.
This is probably the simplest approach. But its limitation is that you cannot reflect any change of the original jaxws attachments-map into the actual cxf's attachments-set stored in the context, once this cxf's attachments-set is created and inserted.
introduce package local WrappedAttachments that holds the original jaxws's attachments-map and expose it as the cxf's attachments-set. That means, when the jaxws's attachments-map is inserted, WrappedMessageContext can wrap it with WrappedAttachments which is treated as cxf's attachments-set. In this way, any operations on cxf's attachments-set or jaxws' attachments-map remain consistent.
Option 2 is more flexible than option 1 and prevents potential confusion. So, I think we can choose option 2.