SMTP Transport Binding for SOAP 1.1

29 November 2001

This version:
http://www.pocketsoap.com/specs/smtpbinding/smtp_001.htm
Latest version:
http://www.pocketsoap.com/specs/smtpbinding/
Authors (alphabetically):
Robert Cunnings, Lectrosonics, Inc.
Simon Fell
Paul Kulchenko

Abstract

SOAP [1] is a lightweight protocol for exchange of information in a decentralized, distributed environment, using XML. This document details transporting SOAP messages over the Simple Mail Transport Protocol (SMTP). [2]

Status

This is an editors draft.

Table of Contents

1. Introduction
1.1 Notational Conventions
2. Use Of MIME
2.1 Content-Type
2.2 Content-Transfer-Encoding
3. Identifying SMTP transports in WSDL
4. Request / Response semantics
5. Examples
6. Security Considerations
7. References

1. Introduction

By binding SOAP to SMTP, we can take advantage of SMTP's store and forward messaging to provide an asynchronous one way transport for SOAP. Two one way messages can be correlated to provide request / response semantics (this closely follows the SOAP model). This allows SOAP to be used in a number of scenarios where HTTP is not suitable (partially connected nodes, one way notifications etc.)

1.1 Notational Conventions

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC-2119 [3].

2. Use of MIME

SOAP payloads in SMTP MUST to be packaged into a MIME [4] message. This provides a standard packaging layer that can take care of specifying transfer encodings, to cope with SMTP's 7bit nature. Many SMTP tools already support MIME, so this shouldn't be a burden.

2.1 Content-Type

SOAP 1.1 payloads MUST be sent with the content type of "text/xml" when SOAP entity body is encoded as a single-part MIME message. The charset parameter SHOULD be used to specify the character encoding as per RFC2046 [5]

2.2 Content-Transfer-Encoding

A content transfer encoding of base64 is RECOMMENDED. A content transfer encoding of Quoted-Printable MAY be used if the SOAP payload meets the line oriented requirements of RFC 2045 [4]

3. Identifying SMTP transports in WSDL

The URI http://schemas.pocketsoap.com/soap/smtp SHOULD be used to identify SMTP transports compliant with this specification in the transport attribute of the soap:binding element of a WSDL [6] document (see section 3.3 of the WSDL spec.)

The address of the SOAP service in the soap:address element of a WSDL document SHOULD be given by a URL based on the "mailto" URL scheme as defined by RFC 2368 [7]

4. Request / Response semantics

SOAP applications requiring request / response semantics will need to perform some sort of message correlation. This SHOULD be achieved via the standard Message-Id and In-Reply-To SMTP headers [8]. The request will include a Message-Id header, and the associated response should include a In-Reply-To header that contains the Message-Id of the request, and a new Message-Id header.

The responder SHOULD also reflect the incoming subject header into the response, with no modifications.

5. Example

A request destined for soap@example.org

To: <soap@example.org>
From: <soap@client.com>
Reply-To: <soap@client.com>
Date: Tue, 15 Nov 2001 23:27:00 -0700
Message-Id: <1F75D4D515C3EC3F34FEAB51237675B5@client.com>
MIME-Version: 1.0
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle=3D"http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENC=3D"http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV=3D"http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema"
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<m:echoString xmlns:m=3D"http://soapinterop.org/">
<inputString>get your SOAP over SMTP here !</inputString>
</m:echoString>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The resulting response from soap@example.org

To: <soap@client.com>
From: <soap@example.org>
Date: Tue, 13 Nov 2001 23:27:00 -0700
In-Reply-To: <1F75D4D515C3EC3F34FEAB51237675B5@client.com>
Message-Id: <FF75D4D515C3EC3F34FEAB51237675B5@soap.example.org>
MIME-Version: 1.0
Content-Type: TEXT/XML; charset=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle=3D"http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENC=3D"http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV=3D"http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema"
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<m:echoStringResponse xmlns:m=3D"http://soapinterop.org/">
<return>get your SOAP over SMTP here !</return>
</m:echoStringResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

6. Security Considerations

This should introduce no new security considerations.

7. References

[1] Box, D., Ehnebuske, D., Kakivaya, G., Layman, A., Mendelsohn, N., Nielsen, H. F., Thatte, S. and D. Winer, "Simple Object Access Protocol (SOAP) 1.1", May 2000.

[2] Klensin J., "Simple Mail Transfer Protocol" RFC2821, April 2001.

[3] Bradner S., "Key words for use in RFCs to Indicate Requirement Levels", RFC 2119, Harvard University, March 1997

[4] Freed N., Borenstein N. "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies" RFC2045, November 1996.

[5] Freed N., Borenstein N. "Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types" RFC2046, November 1996.

[6] Christensen E., Curbera F., Meredith G., Weerawarana S. "Web Services Description Language (WSDL) 1.1", March 2001.

[7] Hoffman P., Masinter L., Zawinski J. "The mailto URL scheme" RFC2368, July 1998.

[8] Crocker D.H., "Standard for the format of ARPA internet text messages" RFC822, August 1982.