I need to send a binary file from the server to a client, yet I am not sure where/when to actually add the attachment (on the server) and how to get access to the attachment on the client side.
So far I'm trying this:
DataHandler dh = new DataHandler(new FileDataSource("/tmp/ws_expor.xls"));
SOAPMessageContext smc = (SOAPMessageContext) MessageContext.getCurrentContext();
boolean isNull = smc==null;
logger.info("is smc == null?"+isNull);
AttachmentPart ap = smc.getMessage().createAttachmentPart();
ap.setDataHandler(dh);
smc.getMessage().addAttachmentPart(ap);
Any answers or pointers to samples/documentation would be extremely helpful.
Thank you,
Tom
