Attaching file to Web Service
I have the this code inside my web method:
MessageContext context = null;
Message responseMessage = null;
SOAPBody responseBody = null;
SOAPEnvelope responseEnvelope = null;
SOAPElement responseElement = null;
context = MessageContext.getCurrentContext();
if( context!=null )
{
responseMessage = context.getResponseMessage();
if( responseMessage!=null )
{
try {
responseBody = (SOAPBody)responseMessage.getSOAPBody();
} catch (SOAPException e) {
}
try {
responseEnvelope = responseMessage.getSOAPEnvelope();
} catch (AxisFault e) {
}
AttachmentPart attachPart = null;
DataHandler dh = new DataHandler( new FileDataSource("C:/t1.txt"));
attachPart = (AttachmentPart)responseMessage.createAttachmentPart(dh);
attachPart.setContentId("attachment-1");
responseMessage.addAttachmentPart(attachPart);
But a I have this error:
java.lang.RuntimeException: No support for attachments
Help me :(

