Re: [apps-discuss] Question regarding RFC 7303

Stefan Cordes <stefan.cordes@canda.com> Tue, 12 July 2016 10:12 UTC

Return-Path: <prvs=0001001816=stefan.cordes@canda.com>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C07AC12D0AA for <apps-discuss@ietfa.amsl.com>; Tue, 12 Jul 2016 03:12:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.92
X-Spam-Level:
X-Spam-Status: No, score=-1.92 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AxkZo4SxhxyS for <apps-discuss@ietfa.amsl.com>; Tue, 12 Jul 2016 03:12:03 -0700 (PDT)
Received: from gatem.retail-sc.com (gatem.retail-sc.com [195.39.227.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5B32812B017 for <apps-discuss@ietf.org>; Tue, 12 Jul 2016 03:12:03 -0700 (PDT)
Received: from m1.intdus.retail-sc.com ([10.0.243.143]) by gatem.retail-sc.com (Exim 4.80.1) with esmtp id 1bMufU-0001ni-Hf; Tue, 12 Jul 2016 12:11:56 +0200
Received: from [10.16.2.190] (helo=intdusmhc1.intdus.retail-sc.com) by m1.intdus.retail-sc.com (Exim 4.80.1) with esmtp id 1bMufU-0002bo-FK; Tue, 12 Jul 2016 12:11:56 +0200
Received: from dedusmsc2.intdus.retail-sc.com ([10.16.2.177]) by intdusmhc1.intdus.retail-sc.com (IBM Domino Release 9.0.1FP2 HF590) with ESMTP id 2016071212115625-30307 ; Tue, 12 Jul 2016 12:11:56 +0200
In-Reply-To: <f5b37nfcjb0.fsf@troutbeck.inf.ed.ac.uk>
References: <OFD07488E0.FAA41B38-ONC1257FED.0023B49B-C1257FED.00255F92@retail-sc.com> <f5b37nfcjb0.fsf@troutbeck.inf.ed.ac.uk>
To: ht@inf.ed.ac.uk
MIME-Version: 1.0
X-KeepSent: 777BAE8E:791CC93D-C1257FEE:0035AD7E; type=4; flags=0; name=$KeepSent
X-Mailer: IBM Notes Release 9.0.1 October 14, 2013
Message-ID: <OF777BAE8E.791CC93D-ONC1257FEE.0035AD7E-C1257FEE.0038064B@retail-sc.com>
From: Stefan Cordes <stefan.cordes@canda.com>
Date: Tue, 12 Jul 2016 12:11:56 +0200
X-MIMETrack: Serialize by Router on dedusMSC2/server/retail-sc(Release 9.0.1FP2 HF590|December 11, 2014) at 07/12/2016 12:11:56 PM, Serialize complete at 07/12/2016 12:11:56 PM, Itemize by SMTP Server on intdusMHC1/server/retail-sc(Release 9.0.1FP2 HF590|December 11, 2014) at 07/12/2016 12:11:56 PM, Serialize by Router on intdusMHC1/server/retail-sc(Release 9.0.1FP2 HF590|December 11, 2014) at 07/12/2016 12:11:56 PM
Content-Type: multipart/related; boundary="=_related 0038064AC1257FEE_="
X-m1-Scan-Signature: 555fb9db288b99949848c0da3d1cf8ee
X-RSC-MailScanner-Information: W1
X-RSC-MailScanner-ID: 1bMufU-0001ni-Hf
X-RSC-MailScanner: Found to be clean
X-RSC-MailScanner-From: stefan.cordes@canda.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/apps-discuss/aA6zJBsfr20l0G48CXd-u4UKX1A>
X-Mailman-Approved-At: Sun, 17 Jul 2016 07:14:08 -0700
Cc: svacas <notifications@github.com>, apps-discuss@ietf.org
Subject: Re: [apps-discuss] Question regarding RFC 7303
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/apps-discuss/>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 12 Jul 2016 10:12:06 -0000

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



C&A Services GmbH & Co. OHG | Wanheimer Str. 70 | 40468 Düsseldorf
T +49 211 9872 2501 | stefan.cordes@canda.com

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

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



From:   ht@inf.ed.ac.uk (Henry S. Thompson)
To:     Stefan Cordes <stefan.cordes@canda.com>
Cc:     apps-discuss@ietf.org, svacas <notifications@github.com>
Date:   12.07.2016 11:11
Subject:        Re: [apps-discuss] Question regarding RFC 7303



Stefan Cordes writes:

> 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 )

Yes, it's complicated and not completely ideal.

> 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 ?

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

> 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".

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: ht@inf.ed.ac.uk
                       URL: http://www.ltg.ed.ac.uk/~ht/
 [mail from me _always_ has a .sig like this -- mail without it is forged 
spam]

!DSPAM:5784b45210114371920009!