axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glen Daniels" <>
Subject Re: Proposed change to Message API
Date Sun, 28 Oct 2001 16:25:43 GMT
Hi, Rob!

Attachments aren't something that can be "bolted on" to an existing
mechanism, they have to be designed in at the core, IMHO.

Take a look at the JAXM SOAPMessage class and its associates:

I think that a similar pattern makes a lot of sense.  Messages contain
parts, and there's a distinguished SOAP part.  In the case of a non-MIME
message, there is ONLY the SOAP part.  When you say Message.getAsBytes(),
you get the whole message incl MIME wrapper.  You could also do
SOAPPart.getAsBytes() if you want...  make sense?


P.S.  I'm here :)  I'm back from a conference earlier this week, and still
catching up.  Will be replying to a bunch of the recent threads today.

----- Original Message -----
From: "Rob Jellinghaus" <>
To: <>
Sent: Friday, October 26, 2001 5:42 PM
Subject: Proposed change to Message API

> I'm working on building the infrastructure for streaming sending of Axis
attachments.  Unfortunately, right now, this is impossible due to the
current Message class.
> The Message.getAsBytes() and Message.getAsString() methods are heavily
used in our send-side code (on client and server side).  Of course, these
methods kill streaming.
> Additionally, currently the Message class only contains the root part (in
the SOAP Attachments sense).  What happens with attachments?  Should
getAsBytes() return the entire MIME enclosure, or not?
> I propose the following changes to Message:
> - Rename getAsBytes(), getAsString() to getRootAsBytes(),
> - Add writeRoot(OutputStream), writeWhole(OutputStream) for streaming
> (writeRoot(OutputStream) just writes the root part,
> writeWhole(OutputStream) writes the whole MIME enclosure)
> - Add getRootContentLength(), getRootContentType(),
> getWholeContentLength(), getWholeContentType()
>       (all of which will be implemented as efficiently as possible)
> In Axis installations without mail.jar and activation.jar, and/or without
attachment support, the "Root" and "Whole" methods return the same values.
i.e. without attachments, the root *is* the whole.
> I think it is mildly grotty to introduce these somewhat-duplicated
methods.  But I also think it clarifies, straightforwardly, each method's
job.  Basically, attachments break the assumption that the whole message and
the root part of the message are the same, and I think that assumption
change has to be reflected in Message *somehow*.
> (Actual methods to get and set the content of individual attachments is
still broken out into a separate interface, and none of these changes to the
base Message class would force mail.jar or activation.jar to be available.)
> +1's?  -1's?
> I am underway on this now.
> Cheers,
> Rob
> (p.s. Where's Glen???  Hope he's OK... anyone know?)

View raw message