dev@fi.java.net

Re: Protocol negotiation code in FI project?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 10 Jan 2005 15:54:23 +0100

Eduardo Pelegri-Llopart wrote:
>
> Will the implementation of protocol negotiation be in the FI project? Or
> in the JAX-RPC project? My inclination is to put it in the FI project,
> since it is code that other implementations of FI will want to implement
> too.
>

In the case of FI the term 'protocol negotiation' might be better termed
'content negotiation' since for the transmission of documents serialized
as FI or XML the higher level protocol associated with the infoset does
not change, only the transfer syntax changes.

For example the W3C SOAP rec. allows for different serializations of the
SOAP message infoset without modification of the SOAP protocol. The HTTP
protocol (transport protocol) can be used to perform the content
negotiation to use the most appropriate transfer syntax.

I would argue that Fast Web Services using Binary SOAP messages is
actually a different protocol that is compatible with W3C SOAP, but we
may be getting slightly off topic... :-)


Content negotiation is specific to the transport protocol being used,
and then it is specific to the implementation of the transport protocol.
Although negotiation it is easy to describe abstractly i am not so sure
it would be of much benefit to provide such general functionality.

Given my knowledge of JAX-RPC and its use of HTTP i think it would more
efficient and easier to support such a feature in JAX-RPC since JAX-RPC
has control of the request/responses and is best positioned to manage
the message pattern.


Some general information on content negoatiation.

The HTTP protocol, for the transmission of SOAP messages or XML
documents, provides all the necessary features to support negotiation.

There are two forms that could be used:

1) Pessimistic; or
2) Optimistic.

For pessimistic negotiation a client sends an XML message but states
using the Accept header that it can recieve an FI message or an XML
message (the former taking priority). If the server supports FI then it
will reply with an FI message otherwise will reply with an XML message.
The client can then send subsequent requests using FI or XML.

For optimistic content negotiation a client sends an FI message. The
server either responds with an FI message or an HTTP error (400 IIRC).
If the error occurs then the client resends as an XML message.

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_fi.dev.java.net
For additional commands, e-mail: dev-help_at_fi.dev.java.net