Re: [ogpx] content negotiation for LLSD over HTTP connections

"Hurliman, John" <john.hurliman@intel.com> Sat, 27 June 2009 01:30 UTC

Return-Path: <john.hurliman@intel.com>
X-Original-To: ogpx@core3.amsl.com
Delivered-To: ogpx@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id A15193A6BE4 for <ogpx@core3.amsl.com>; Fri, 26 Jun 2009 18:30:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.599
X-Spam-Level:
X-Spam-Status: No, score=-6.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 17qXE6BGSChD for <ogpx@core3.amsl.com>; Fri, 26 Jun 2009 18:30:00 -0700 (PDT)
Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by core3.amsl.com (Postfix) with ESMTP id 868BA3A6BC8 for <ogpx@ietf.org>; Fri, 26 Jun 2009 18:30:00 -0700 (PDT)
Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 26 Jun 2009 18:30:19 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="4.42,299,1243839600"; d="scan'208";a="159047754"
Received: from rrsmsx602.amr.corp.intel.com ([10.31.0.33]) by azsmga001.ch.intel.com with ESMTP; 26 Jun 2009 18:30:18 -0700
Received: from rrsmsx506.amr.corp.intel.com ([10.31.0.39]) by rrsmsx602.amr.corp.intel.com ([10.31.0.33]) with mapi; Fri, 26 Jun 2009 19:30:18 -0600
From: "Hurliman, John" <john.hurliman@intel.com>
To: Infinity Linden <infinity@lindenlab.com>, "ogpx@ietf.org" <ogpx@ietf.org>
Date: Fri, 26 Jun 2009 19:30:15 -0600
Thread-Topic: [ogpx] content negotiation for LLSD over HTTP connections
Thread-Index: Acn2uJIeNWMVOACMQ/yqb2lAWcx0qwADYN5Q
Message-ID: <62BFE5680C037E4DA0B0A08946C0933D9123A6A4@rrsmsx506.amr.corp.intel.com>
References: <3a880e2c0906261648k1a14024cudd4cbccb57d8753f@mail.gmail.com>
In-Reply-To: <3a880e2c0906261648k1a14024cudd4cbccb57d8753f@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [ogpx] content negotiation for LLSD over HTTP connections
X-BeenThere: ogpx@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Virtual Worlds and the Open Grid Protocol <ogpx.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/ogpx>, <mailto:ogpx-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/ogpx>
List-Post: <mailto:ogpx@ietf.org>
List-Help: <mailto:ogpx-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ogpx>, <mailto:ogpx-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 27 Jun 2009 01:30:01 -0000

This is how we're using LLSD. It will accept any of the three serializations: XML, JSON, and binary. Notation support was (thankfully) removed when the LLSD/LLIDL draft was posted. It uses a basic algorithm to try and figure out what content type the data is (since no one sets their content type headers correctly or can even agree what the content type string should be). However, only JSON data is sent. The standard "application/json" mime type is used since we're using a subset of LLIDL that is always compliant with the JSON RFC.

John

>-----Original Message-----
>From: ogpx-bounces@ietf.org [mailto:ogpx-bounces@ietf.org] On Behalf Of
>Infinity Linden
>Sent: Friday, June 26, 2009 4:48 PM
>To: ogpx@ietf.org
>Subject: [ogpx] content negotiation for LLSD over HTTP connections
>
>so... we have three serialization formats for LLSD messages over HTTP:
>XML, JSON and Binary. each has it's own uses and constituency.
>
>but it _does_ leave implementers and deployers with questions like:
>
>* must i support each and every LLSD defined serialization?
>* under what circumstances should i choose one over the other?
>* what if i am a server and i only want to use one serialization?
>* what if i am a client and i only want to use one serialization?
>
>i have some opinions (of course). but i wanted to ask implementer's
>opinions on these questions... so here's a starting point for
>discussion...
>
>THE BACKSTORY
>
>way back in the day, some people noticed SL's proto-LLSD "annotation
>format" looked an aweful lot like JSON. users with a copy of ethereal
>/ wireshark could see lotsa XML flying around too. so when public
>discussions of OGP came along, people naturally thought that LLSD
>SHOULD be serialized using JSON ("cause... you know.. like the whole
>web is movign to JSON, dude.") well... except those people who thought
>it should be serialized using XML, since XML was the king of all
>structured information interchange formats. and then there were the
>people who said, "oh noes! you have to use a binary format to get
>efficiency!"
>
>all these different stakeholders have valid points. and that's part of
>why we have LLSD as an abstract type system with three defined
>serializations today.
>
>THE MORE RECENT BACKSTORY
>
>then last year when we started the interop work, software engineers
>had to code message parsers and the like. for the most part, we
>ignored JSON and binary serializations and focused on XML. but.. we
>know we can't do that moving forward.
>
>THE PROBLEM
>
>what we only started handling last year was addressing the questions
>above: should my service support ALL serializations? what do i do if i
>get a serialization i don't like? or can't understand?
>
>THE SOLUTION (we wanted to implement last year but didn't have time for)
>
>inspired by the words "an implementation should be conservative in its
>sending behavior, and liberal in its receiving behavior," [RFC760] we
>figured a generally available service SHOULD accept messages
>serialized with all three defined serializations (XML, JSON & Binary,)
>but SHOULD probably try to send things using one serialization.
>
>we're using the word "SHOULD" here in case you're building a service
>where you control both the producer and consumer of a service and only
>want to support one serialization (maybe you have a super-fancy
>hardware XML parser and you choke when you get JSON or something.) i
>think there's general agreement that we don't want to force deployers
>/ implementers in these situations to use a serialization that will be
>difficult for them.
>
>and maybe you're a developer building a new client, and you were able
>to get the JSON library to build on your system, but expat remains
>unavailable. we don't want to force you to support XML in this case.
>
>but... in all these cases there are probably very good ideas to
>support the other serializations, but we're going to let you analyze
>the trade-offs.
>
>so... back to the questions above... should a well defined service
>accept requests using all three LLSD serializations? i vote "yes." it
>is in keeping with internet tradition and a generally good idea. when
>a client uses HTTP to transport an OGP message from client to server
>via PUT or POST, it may include a Content-Type: header to tell the
>server about the serialization it is using. if the client wants a
>response using a particular serialization, it can use the Accept:
>header.
>
>so.. question... what should happen if the server doesn't want to use
>the serialization(s) specified in the Accept: header? or the client
>identifies a serialization the server just doesn't understand? Maybe a
>406 or 415 response?
>
>anyway. this is just an initial post to get the discussion started.
>
>if you have any opinions one way or another, please voice them here.
>
>-cheers
>-meadhbh
>_______________________________________________
>ogpx mailing list
>ogpx@ietf.org
>https://www.ietf.org/mailman/listinfo/ogpx
>