You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by bu...@apache.org on 2003/03/05 11:20:42 UTC

DO NOT REPLY [Bug 17664] New: - SOAPMessage MimeHeaders not being created for attachments

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17664>.
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=17664

SOAPMessage MimeHeaders not being created for attachments

           Summary: SOAPMessage MimeHeaders not being created for
                    attachments
           Product: Axis
           Version: 1.1RC1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Basic Architecture
        AssignedTo: axis-dev@ws.apache.org
        ReportedBy: hags@metahusky.net


Whilst trying to implement a JAXMServlet I ran into a problem with SOAPMessage.

Basically if you create a SOAPMessage with attachments then via the "SAAJ" api
you don't have access to any information that would allow you to create a SOAP
reply, ie the raw content of a reply to an HTTP request.  The missing bit being
a suitable Content-Type with the attachment delimiter.

I would have expected this to be already set and accessible via the
getMimeHeaders() (and indeed the Sun reference implementation does this). 
However, in Axis getMimeHeaders() just returns an empty set.

I put in a workaround fix in my code by doing the following evil kludge:

if ( msg.getMimeHeaders().getHeader( "Content-Type" ) == null ) {
    org.apache.axis.Message message = (org.apache.axis.Message) msg;
    String content = message.getAttachmentsImpl().getContentType();
    msg.getMimeHeaders().addHeader( "Content-Type", content );
}

so the information is clearly floating around in the system, but just never set
in the SOAPMessage itself.