File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
ph-as4-lib/src/main/java/com/helger/as4/messaging/mime Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ public static MimeMessage generateMimeMessage (@Nonnull final ESOAPVersion eSOAP
9696 ValueEnforcer .notNull (aSOAPEnvelope , "SOAPEnvelope" );
9797
9898 final Charset aCharset = AS4XMLHelper .XWS .getCharset ();
99- final SoapMimeMultipart aMimeMultipart = new SoapMimeMultipart (eSOAPVersion );
99+ final SoapMimeMultipart aMimeMultipart = new SoapMimeMultipart (eSOAPVersion , aCharset );
100100 final EContentTransferEncoding eCTE = EContentTransferEncoding .BINARY ;
101101 final String sContentType = eSOAPVersion .getMimeType (aCharset ).getAsString ();
102102
Original file line number Diff line number Diff line change 1616 */
1717package com .helger .as4 .messaging .mime ;
1818
19+ import java .nio .charset .Charset ;
20+
1921import javax .annotation .Nonnull ;
2022import javax .mail .internet .ContentType ;
2123import javax .mail .internet .MimeMultipart ;
3133 */
3234public class SoapMimeMultipart extends MimeMultipart
3335{
34- public SoapMimeMultipart (@ Nonnull final ESOAPVersion eSOAPVersion ) throws ParseException
36+ public SoapMimeMultipart (@ Nonnull final ESOAPVersion eSOAPVersion ,
37+ @ Nonnull final Charset aCharset ) throws ParseException
3538 {
3639 super ("related" );
3740
3841 // type parameter is essential for Axis to work!
39- // But only without the charset! Otherwise Holodeck complains that the
40- // receiver is unknown. Somewhat a bug in Axis according to Sander
41- final ContentType cType = new ContentType ( contentType );
42- cType .setParameter ("type " , eSOAPVersion . getMimeType (). getAsString ());
43- contentType = cType .toString ();
42+ // But no charset! RFC 2387, section 3.4 has a special definition
43+ final ContentType aContentType = new ContentType ( contentType );
44+ aContentType . setParameter ( "type" , eSOAPVersion . getMimeType (). getAsString () );
45+ aContentType .setParameter ("charset " , aCharset . name ());
46+ contentType = aContentType .toString ();
4447 }
4548}
You can’t perform that action at this time.
0 commit comments