Subject: [apps-discuss] Question regarding RFC 7303

From: Stefan Cordes <[email-masked]>
Date: Mon, 11 Jul 2016 08:48:12 +0200

Hi,
with https://github.com/mulesoft/apikit/pull/88#issuecomment-231617946
we came in some discussions about

https://tools.ietf.org/html/rfc7303#section-3.2

where sometimes the "MIME Content-Type header" is ignored ( 
https://tools.ietf.org/html/rfc7303#section-8.9 )
 and sometimes the "XML encoding declaration" is ignored ( 
https://tools.ietf.org/html/rfc7303#section-8.8 )

Sounds to me a little bit unclear:

Transport does not touch characters in the body in case a "BOM" is 
available?
Transport converts all characters in the body to "MIME Content-Type" when 
receiving ?

Especially scenario 8.8 https://tools.ietf.org/html/rfc7303#section-8.8 
seems not to work, as
base64 transport does not change anything in the xml-body and gives all 
the characters as they were sent into the DocumentBuilder.parse(...).

So in my point of view the "MIME Content-Type header" should be ignored in 
all cases for "application/xml".

Gruß,

Stefan Cordes
A-2.26

C&A Services GmbH & Co. OHG | Wanheimer Str. 70 | 40468 Düsseldorf
T +49 211 9872 2501 | [email-masked]

Visit us on www.c-a.com or www.facebook.com/ca

Please consider the environmental impact of needlessly printing this 
e-mail.

---

From: [email-masked] (Henry S. Thompson)
Date: Tue, 12 Jul 2016 10:11:31 +0100

> https://tools.ietf.org/html/rfc7303#section-8.8 )

Yes, it's complicated and not completely ideal.

> Transport converts all characters in the body to "MIME Content-Type" when 

Not sure what you mean by 'transport' here...

> all cases for "application/xml".

Could you be a bit more specific as to what your actual question is?

Thanks,

ht
-- 
       Henry S. Thompson, School of Informatics, University of Edinburgh
      10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
                Fax: (44) 131 650-4587, e-mail: [email-masked]
                       URL: http://www.ltg.ed.ac.uk/~ht/
 [mail from me _always_ has a .sig like this -- mail without it is forged spam]

---

From: Stefan Cordes <[email-masked]>
Date: Tue, 12 Jul 2016 12:11:56 +0200

Hi ht,

my idea was to pass the "application/xml" Stream (assuming it is streamed 
by sender)
directly to

        tempDoc = 
DocumentBuilderFactory.newDocumentBuild().parse(inputStream);

But to be rfc7303 conform we first need to check if there is a BOM at the 
beginning of the Stream 
and if not take the "MIME Content-Type header" encoding to use 

        parse(new StringSource(new 
String(bytesFormStream,mimeTypeHeader));

and so overruling the encoding setting in the xml header.
But that approach works does not work in my point of view as the sender 
had created the OutputStream with an XML Transformer with encoding 
specified in the xml-declaration and not with the http content type (in 
case it is different).

So my question is to change the "conflict section" in that way that the 
xml-body MUST be parsed with the encoding specified in the xml-declaration 
always (or UTF-.. in case of BOM)
and ignore the "MIME Content-Type header".

Gruß,

Stefan Cordes
A-2.26

From:   [email-masked] (Henry S. Thompson)
To:     Stefan Cordes <[email-masked]>
Cc:     [email-masked], svacas <[email-masked]>
Date:   12.07.2016 11:11
Subject:        Re: [apps-discuss] Question regarding RFC 7303

Thanks,

ht
 [mail from me _always_ has a .sig like this -- mail without it is forged 
spam]

!DSPAM:5784b45210114371920009!