Hi!

I am trying to create java web service which returns image. I'm trying to do it with attachment, but I constantly get null pointer exception, after:

MessageContext context = MessageContext.getCurrentContext();
Message msg = context.getMessage();
AttachmentPart ap = msg.createAttachmentPart();
(NullPointerException)

Can anybody please tell me what I am doing wrong?

Thnx in advanced

rko1