axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James M Snell" <jasn...@us.ibm.com>
Subject Re: SOAP Attachment
Date Sat, 27 Oct 2001 16:54:39 GMT
In thinking this over a bit more (as part of my Message API improvement 
proposal) I'm thinking along the same lines.  More details later.

- James M Snell/Fresno/IBM
    Web services architecture and strategy
    Internet Emerging Technologies, IBM
    544.9035 TIE line
    559.587.1233 Office
    919.486.0077 Voice Mail
    jasnell@us.ibm.com
=================================================================
Have I not commanded you?  Be strong and courageous.  Do not be terrified, 

do not be discouraged, for the Lord your God will be with you wherever you 
go.  
- Joshua 1:9

Please respond to axis-dev@xml.apache.org 
To:     axis-dev@xml.apache.org, axis-dev@xml.apache.org
cc: 
Subject:        Re: SOAP Attachment



At 10:43 PM 10/23/2001 -0700, James M Snell wrote:
>Well... I'm not sure with the current Message API, but with the changes
>that I have in mind (not yet finalized or completely thought out), each
>service will use a specific Message factory class for creating messages.
>If the service supports or requires messages with attachments, then all
>messages created by that services message factory will be an instance of
>MessageWithAttachments.  If the service does not support messages with
>attachments, then all messages created will be instances of Message.

I think that this is the wrong way to break out attachment functionality. 
Organizing subclasses this way could lead to an explosion of subclasses 
(Message, SOAPMessage, MessageWithAttachments, 
SOAPMessageWithAttachments...).

My upcoming pass on the message API (see my last email) will break out 
attachment-specific functionality into an "attachments object" which can 
be part (or not) of any Message.

Likewise, for SOAP versus other message formats (XML-RPC?), I think that 
rather than defining multiple subclasses of Message, we should instead 
define multiple classes of Envelope.  I agree with you that 
org.apache.axis.SOAPEnvelope seems wrong -- it's too high-level a 
dependency on SOAP.  org.apache.axis.message.soap.SOAPEnvelope (or even 
org.apache.axis.soap.SOAPEnvelope) would be better, I think.  Of course, 
then there would need to be org.apache.axis.Envelope as an actual class, 
which doesn't exist either.

To sum up, I would rather have
        public Envelope Message.getAsEnvelope()
and
        public Object Message.getAttachments()

So to get the attachments from any message, whether it is a SOAP message 
or not, you just do "myAttachments = 
(MessageAttachments)myMessage.getAttachments();"

Does this make sense?  In a nutshell: don't parameterize Message by 
subclassing, parameterize it with contained objects.

Cheers!
Rob





Mime
View raw message