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 Taras Shkvarchuk <ta...@grandcentral.com> on 2002/01/30 02:37:15 UTC

Axis and attachments (non-RPC)

I was looking at the Axis for non-RPC messaging, and noticed that there
isn't much there. (not even in TODO comments that I saw).
What is the planned future?

1) No clean way to set Content-Id of attachments.
You have to extract all of the attachments from the Attachments class,
change headers manually, then re add them to the Attachments.
1b) If you update Content-Id of the Attachment, it will not be saved unless
you re-add it to attachments.
1c) *BUG* Mime allows for duplicate headers, but they get eaten by HashMap
here.

2) There is no way to add an attachment to the list if you already have one.
>From another message lets say.

Example:
			Attachments atts=msg.getAttachments();
			DataHandler dh=new DataHandler(new
FileDataSource("data.dat"));
			AttachmentPart
part=(AttachmentPart)atts.createAttachmentPart(dh);
			part.addMimeHeader(HTTPConstants.HEADER_CONTENT_ID ,
"myAttachmentId");
			ArrayList parts=new ArrayList(2);
			parts.add(part);
			atts.setAttachmentParts(parts);

2b) Needs add(AttachmentPart), getAttachmentByContentId(), getIterator() -
Would be nice if remove() and add() would function on iterator.

3) Reading contents of the AttachementPart is awkward.
getActiviationDataHandler() method is not public, but is on package level.
Is it a typo or as intended?
AttachmentUtils has     public static DataHandler
getActiviationDataHandler(Part part)   method, but its kind of odd way of
doing it.

4) There is nice BoundaryDelimitedStream to read the attachments, but you
still rely on scary javax.mail code to create outgoing messages. Are there
any plans to change that?

P.S. What is the preferred way of sending patches, since only committers
have write access to cvs?

-Taras

Re: Axis and attachments (non-RPC)

Posted by Davanum Srinivas <di...@yahoo.com>.
Taras,

Please follow instructions on Patches at http://xml.apache.org/source.html. Basically you will
have to do a "cvs diff -u" and send the output to this mailing list.

Thanks,
dims

--- Taras Shkvarchuk <ta...@grandcentral.com> wrote:
> I was looking at the Axis for non-RPC messaging, and noticed that there
> isn't much there. (not even in TODO comments that I saw).
> What is the planned future?
> 
> 1) No clean way to set Content-Id of attachments.
> You have to extract all of the attachments from the Attachments class,
> change headers manually, then re add them to the Attachments.
> 1b) If you update Content-Id of the Attachment, it will not be saved unless
> you re-add it to attachments.
> 1c) *BUG* Mime allows for duplicate headers, but they get eaten by HashMap
> here.
> 
> 2) There is no way to add an attachment to the list if you already have one.
> From another message lets say.
> 
> Example:
> 			Attachments atts=msg.getAttachments();
> 			DataHandler dh=new DataHandler(new
> FileDataSource("data.dat"));
> 			AttachmentPart
> part=(AttachmentPart)atts.createAttachmentPart(dh);
> 			part.addMimeHeader(HTTPConstants.HEADER_CONTENT_ID ,
> "myAttachmentId");
> 			ArrayList parts=new ArrayList(2);
> 			parts.add(part);
> 			atts.setAttachmentParts(parts);
> 
> 2b) Needs add(AttachmentPart), getAttachmentByContentId(), getIterator() -
> Would be nice if remove() and add() would function on iterator.
> 
> 3) Reading contents of the AttachementPart is awkward.
> getActiviationDataHandler() method is not public, but is on package level.
> Is it a typo or as intended?
> AttachmentUtils has     public static DataHandler
> getActiviationDataHandler(Part part)   method, but its kind of odd way of
> doing it.
> 
> 4) There is nice BoundaryDelimitedStream to read the attachments, but you
> still rely on scary javax.mail code to create outgoing messages. Are there
> any plans to change that?
> 
> P.S. What is the preferred way of sending patches, since only committers
> have write access to cvs?
> 
> -Taras


=====
Davanum Srinivas - http://jguru.com/dims/

__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com