users@saaj.java.net

Re: [SAAJ-USR] Missing End Boundary

From: Kumar Jayanti <Vbkumar.Jayanti_at_Sun.COM>
Date: Tue, 09 Mar 2010 15:55:19 +0530

Kumar Jayanti wrote:
> Kumar Jayanti wrote:
>> Frank Fetters wrote:
>>> Hello,
>>>
>>> I have a SOAP with attachments MIME message that is missing the
>>> closing boundary. I would like for the MessageFactory.createMessage(
>>> MimeHeaders, IntputStream ) method to throw a SOAPException in
>>> response to this missing closing boundary. I am using SAAJ 1.3.4.
>>>
>>> I've looked through the
>>> com.sun.xml.internal.messaging.saaj.packaging.mime.internet.BMMimeMultipart.java
>>> and MimeMulltipart.java files and I see the lines where the
>>> author(s) commented out the exception's and reasoned that "it is
>>> allowed to have Mime Package without closing boundary".
>>>
>>> With the JavaMail API, I had multiple options for finding out if the
>>> end boundary was missing. The javax.mail.internet.MimeMultipart
>>> class offered an isComplete() method and also respected the
>>> "mail.mime.multipart. ignoremissingendboundary" property. When this
>>> property was false, the MimeMultipart would fail to be created and
>>> would throw an exception.
>>>
>>> Is there a way to have SAAJ reject messages that are missing the
>>> closing boundary that I have missed?
>>> Is this something I should open an issue for or submit an
>>> enhancement for?
>> yes, we could definitely add a "mail.mime.multipart.
>> ignoremissingendboundary" property to SAAJ with default value set to
>> true and throw an error when set to false. It has to be system
>> property though since currently there is no other configuration
>> possible in SAAJ API's (without relying directly on the SAAJ Impl
>> classes).
>>
> The property name could be saaj.mime.multipart. ignoremissingendboundary
I added this feature today :

One property which is only available in the latest builds
<https://saaj.dev.java.net/servlets/ProjectDocumentList?folderID=5118&expandFolder=5118&folderID=0>
(saaj1.3.4.zip) is the system property
*saaj.mime.multipart.ignoremissingendboundary* its default value is
*true *and needs to be set to *false* to indicate that the SAAJ runtime
should report an error if the Multipart Mime Package has a missing end
boundary.

regards,
kumar

>
> regards,
> kumar
>
>> regards,
>> kumar
>>
>>>
>>> Thanks,
>>> Frank
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_saaj.dev.java.net
> For additional commands, e-mail: users-help_at_saaj.dev.java.net
>