How to create attachment in java web service
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();
Can anybody please tell me what I am doing wrong?
Thnx in advanced
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL