MIME-RPC (DRAFT)
Last Update: January 7, 2002
Author: S. Alexander Jacobson
This specification documents MIME-RPC, a protocol for inter-application messaging and object serialization. .
To communicate using MIME-RPC:
Send messages (requests or replies), as MIME messages (as in HTTP and E-mail).
Always send a MIME-RPC: 1.0 header
Use MIME types appropriate for the content sent. This specification defines new content-types:
X-number/integer (body matches regex "-?[0-9]+").
X-number/real (body matches regex "-?[0-9]+(\.[0-9]+)?")
X-number/rational (body matches regex "-?[0-9]+/-?[0-9]+").
X-number/date (body matches YYYY-MM-DD; January is 01)
X-number/time (body matches HH:MM:SS)
X-number/datetime (body matches e.g. 2001-03-27T00:00:01-08:00)
X-null/null (body is "bBk/ALvhqbL1NUUQ2C01Sw" when sent as part of urlencoded struct, ignored otherwise)
If content-type is absent, implementations should try to match the content to an above content-type and then text/plain.
A number of useful types are already defined in various RFCs
RFC 2388: To send a struct (name/value pairs) in which all values are of the above simple types or text/plain, use application/x-www-form-urlencoded. To send a struct that includes any other types, use multipart/form-data.
RFC 2046: To send arrays/lists, use multipart/mixed.
To send complex data structures, use lists and structs recursively.
RFC 1873: To send pointers/references, use message/external-body; access-type="content-id"
RFC 1641: To send unicode use a content-type charset e.g. text/xml; charset="utf-8"
MediaTypes: Use public media types when possible (e.g. text/xml;charset="utf-8", application/jpeg, etc.).
RFC 2048: To define your own types, document and use the format X-type (e.g. application/X-mytype).
To serialize class instances, define a content-type that encapsulates a struct containing the instance data.
To call a function, send a struct associating "0" with the function name, and the other pairs as arguments.
To pass function arguments by position, associate each with its number; e.g. 0=myFun&1=abc&2=def
To denote a fault/exception, include a "fault:" header in your message (in HTTP, still use 200 code with faults)
When using MIME-RPC over asynchronous transports:
To ALLOW an asynchronous response, send both a "Reply-to-url" and a "Message-Id:" header.
To REQUIRE an asynchronous response, also send an "asynch: required" header.
To signal, in a synchronous transaction, that a response will be delivered asynchronously, send a "destination:" header with the URL to which the response will be delivered (the reply-to-URL)
RFC 822: Deliver an asyncrhonous reply to the Reply-to-URL, with an In-Reply-To: header containing the Message-Id of the original message
Wire Format Examples of MIME-RPC communication are here
Implementors and users may need or want to refer to various transport protocols:
HTTP
IMAP
Form based File Upload
SMTP
S/MIME
XML Digital Signatures
OpenSSL
(c) Copyright 2001 i2x, Inc.
MIME-RPC(tm) is a trademark of i2x, Inc.