Instead you want an application interface mechanism, which can adapt dynamically to different levels and versions of service, i.e. network applications which can adapt to each other by negotiations, i.e. plug-and-play.
In order to support such negotiations you need a core application protocol, which supports the negotiation mechanism. X3P is such a protocol. X3P allows services to create authenticated vanilla sessions with each other. Such sessions can then be specialised (extended) to suit the needs of both ends via application negotiations.
X3P is an extensible application communication protocol for peer-to-peer communication between application servers with the following key features:
- very light-weight and easy to understand.
- dynamically extensible - negotiations at the initialisation of the session determines the specialisation of the application session.
- high integrity - back channel used both for peer authentication and service replies.
- very good on exceptions - uses Structured Reasons for exception reports.
- open source reference implementation over HTTP. Minimal API:
- open_session to create a vanilla X3P session,
- session.set_extender allows an X3P service to register an
extension handler
(plug-in) with the session. Theextension handler
is responsible for the application protocol negotiations. - session.request_extension must be used to request a particular application protocol specialisation. The request is passed in a message to the
extension handler
at the other end. - session.alternative_extension may be used by an
extension handler
to propose an alternative protocol. - session.set_handler for
extension handlers
to register plug-in, - session.application_message send datagram to handler at peer end,
- session.application_request send client-server request to handler at peer,
- session.application_reply for handler to reply to client-server request,
- session.close to remove a session.
- proven in practice - used to implement the non-trivial distributed KIX collaboration framework.
X3P is a generic protocol for application functionality negotiation and service binding. The initiator of an X3P peer-to-peer session uses messages to express the desired service specialisation of the session to the responding peer. This may accept or reject a proposed specialisation or alternatively propose a different specialisation (e.g. an older version of an application protocol). See the X3P Protocol Description for more details.
The first X3P version has been implemented in perl5 on top of the HTTP protocol.
X3P provides high service integrity, since it uses independent back channels for authentication, negotiations and application service responses - application data is never sent directly as a response to a request but posted independently to the service address of the requesting service. The X3P implementation software is responsible for joining up the correct response with the corresponding request. Thus the application programmer has nevertheless an API, which mimics a traditional client-server interface.
The first stable version of X3P technology is now available as open source from MetaAgility. It is intended to become an open industry standard. The X3P protocol has initially been used to implement the server-to-server communication in the distributed version of the KIX collaboration framework.