Return-Path: Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 91610 invoked by uid 500); 7 May 2003 14:09:13 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 91560 invoked from network); 7 May 2003 14:09:13 -0000 Date: 7 May 2003 14:11:16 -0000 Message-ID: <20030507141116.10950.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: axis-dev@ws.apache.org Cc: Subject: DO NOT REPLY [Bug 19726] - AttachmentPart getContent does not comply with JAXM standards X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19726 AttachmentPart getContent does not comply with JAXM standards ------- Additional Comments From apache@dreamtimesolutions.com 2003-05-07 14:11 ------- Sorry, I chopped out a very important line in getContent with my cut & paste (there were two fixes required) the entire getContent method reads like this: public Object getContent() throws SOAPException { if(contentObject != null) { return contentObject; } if(datahandler == null) { throw new SOAPException(Messages.getMessage("noContent")); } javax.activation.DataSource ds = datahandler.getDataSource(); // Fix the URLDataSource was missing if ((ds instanceof ManagedMemoryDataSource) || (ds instanceof URLDataSource)) { if (ds.getContentType().equals("text/plain")) { try { java.io.InputStream is = ds.getInputStream(); byte[] bytes = new byte[is.available()]; is.read(bytes); return new String(bytes); } catch (java.io.IOException io) { log.error(Messages.getMessage("javaIOException00"), io); } } else { // Fix this else clause was missing try { return ds.getInputStream(); } catch (java.io.IOException io) { log.error(Messages.getMessage("javaIOException00"), io); } } } return null; }