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).
regards,
kumar
>
> Thanks,
> Frank