| Abstract: | This document defines a structure for providing information about an Uniform Resource Locator (URL), and a protocol signaling retrieval states. |
| Author: | Matthew Miller |
| Copyright: | © 1999 - 2011 XMPP Standards Foundation. SEE LEGAL NOTICES. |
| Status: | Deferred |
| Type: | Standards Track |
| Version: | 0.4 |
| Last Updated: | 2004-01-20 |
WARNING: Consideration of this document has been Deferred by the XMPP Standards Foundation. Implementation of the protocol described herein is not recommended.
1. Introduction
2. Requirements
3. Use Cases
3.1. "Publishing" URLs
3.2. SI Usage
4. Implementation Notes
4.1. Schemes
5. Formal Description
5.1. <url-data/> Root Element
5.2. <desc/> Element
5.3. Error Conditions
5.4. XML Schema
6. Security Considerations
7. IANA Considerations
8. XMPP Registrar Considerations
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
As Jabber becomes more widely utilized, applications of the protocol are veering away from traditional use as an IM product and are utilizing it for more generic data transportation and negotiation. While many advances are being made to facilitate non-IM data transportation, they do not address the use of already-established mechanisms of transporting data via URLs. This document provides a method that is compatible with these data transportation mechanisms and that is based on standard Internet Uniform Resource Locators (see RFC 3986 [1]).
The requirements this protocol fulfills are:
The simplest use of this protocol is to provide just a URL to another entity.
Example 1. Exchanging a simple HTTP URL
<message from='d20M@festhall.outer-planes.net'
to='linuxwolf@outer-planes.net'>
<body>ANNOUNCEMENT: Next Session</body>
<url-data
xmlns='http://jabber.org/protocol/url-data'
target='http://festhall.outer-planes.net/d20M/announce/latest/'/>
</message>
If more information is necessary for successfully using the URL, the sender includes meta-information in a scheme-specific format such as that defined in HTTP Scheme for URL Data [3]:
Example 2. Exchanging a HTTP URL with Headers
<message from='d20M@festhall.outer-planes.net'
to='linuxwolf@outer-planes.net'>
<body>ANNOUNCEMENT: Next Session</body>
<url-data
xmlns='http://jabber.org/protocol/url-data'
xmlns:http='http://jabber.org/protocol/url-data/scheme/http'
target='http://festhall.outer-planes.net/d20M/announce/latest/'>
<http:header name='Cookie'>jsessionid=1324123wdwfq341w1243asdf'</http:header>
</url-data>
</message>
The above example illustrates supplying a HTTP URL with a cookie header. Additional information could be provided, such as HTTP authentication requirements or even POST data.
To support the use of bulk publishing methods such as Publish-Subscribe [4] or messages of type "headline", the <desc/> element is used to provide a textual description:
Example 3. <message/> Headines
<message
from='d20M@festhall.outer-planes.net'
to='linuxwolf@outer-planes.net'
type='headline'>
<body>Complete list of Session Announcements</body>
<url-data
xmlns='http://jabber.org/protocol/url-data'
xmlns:http='http://jabber.org/protocol/url-data/scheme/http'
target='http://festhall.outer-planes.net/d20M/announce/latest/'>
<http:header name='Cookie'>jsessionid=1324123wdwfq341w1243asdf'</http:header>
<desc>Dept-7 d20M Campaign</desc>
</url-data>
<url-data
xmlns='http://jabber.org/protocol/url-data'
xmlns:http='http://jabber.org/protocol/url-data/scheme/http'
target='http://festhall.outer-planes.net/add2/announce/latest/'>
<http:header name='Cookie'>jsessionid=234asa4123wdwfq341w1243asdf'</http:header>
<desc>Forgotten Realms, 2nd Edition</desc>
</url-data>
<url-data
xmlns='http://jabber.org/protocol/url-data'
xmlns:http='http://jabber.org/protocol/url-data/scheme/http'
target='http://festhall.outer-planes.net/dd3/announce/latest/'>
<http:header name='Cookie'>jsessionid=234asa4123wdwfq341w1242341f'</http:header>
<desc>Greyhawk in 3rd Edition</desc>
</url-data>
</message>
To use "url-data" in conjunction with SI, the "sid" attribute of <url-data/> is used. This attribute MUST be equal to the SI session id.
The general process flow for using "url-data" with SI is as follows [5]:
The sender starts with an SI request, using the semantics from XEP-0095:
Example 4. Requesting SI transfer
<iq type='set' id='offer1' to='receiver@jabber.org/resource'>
<si xmlns='http://jabber.org/protocol/si'
id='a0'
mime-type='text/plain'
profile='http://jabber.org/protocol/si/profile/file-transfer'>
<file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
name='test.txt'
size='1022'/>
<feature xmlns='http://jabber.org/protocol/feature-neg'>
<x xmlns='jabber:x:data' type='form'>
<field var='stream-method' type='list-single'>
<option><value>http://jabber.org/protocol/url-data</value></option>
<option><value>http://jabber.org/protocol/bytestreams</value></option>
<option><value>http://jabber.org/protocol/ibb</value></option>
</field>
</x>
</feature>
</si>
</iq>
The receiver then accepts the request, specifying "url-data" as the stream method:
<iq type='result' to='sender@jabber.org/resource' id='offer1'>
<si xmlns='http://jabber.org/protocol/si'>
<feature xmlns='http://jabber.org/protocol/feature-neg'>
<x xmlns='jabber:x:data' type='submit'>
<field var='stream-method'>
<value>http://jabber.org/protocol/url-data</value>
</field>
</x>
</feature>
</si>
</iq>
The sender then sends an <iq/> with type "set" to the receiver, providing the <url-data/> element with the URL in the "target" attribute:
Example 6. Providing <url-data/>
<iq type='set' from='sender@jabber.org/resource' to='receiver@jabber.org/resource' id='offer2'>
<url-data xmlns='http://jabber.org/protocol/url-data'
sid='a0'
target='http://pass.jabber.org:8519/test.txt'/>
</iq>
The receiver attempts to retrieve the data from the given URL. The receiver MUST NOT respond to the <iq/> until the data is completely retrieved, or an error occurs. If the retrieval is successful, the receiver responds with an "iq-result":
Example 7. Receiver responds successfully
<iq type='result' from='receiver@jabber.org/resource' to='sender@jabber.org/resource' id='offer2'>
<url-data xmlns='http://jabber.org/protocol/url-data'
sid='a0'
target='http://pass.jabber.org:8519/test.txt'/>
</iq>
Including the <url-data/> element in the result is NOT REQUIRED.
If the receiver does not understand or support the URL, it responds with an "iq-error" with the <malformed-url/> condition:
Example 8. Receiver does not understand/support URL
<iq type='error' from='receiver@jabber.org/resource' to='sender@jabber.org/resource' id='offer2'>
<url-data xmlns='http://jabber.org/protocol/url-data'
sid='a0'
target='http://pass.jabber.org:8519/thefile.txt'/>
<error type='cancel' code='400'>Malformed URL
<bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<malformed-url xmlns='http://jabber.org/protocol/url-data'/>
</error>
</iq>
If the receiver fails to retrieve data from the URL, it responds with an "iq-error" with the <transfer-failed/> condition:
Example 9. Receiver does not understand/support URL
<iq type='error' from='receiver@jabber.org/resource' to='sender@jabber.org/resource' id='offer2'>
<url-data xmlns='http://jabber.org/protocol/url-data'
sid='a0'
target='http://pass.jabber.org:8519/thefile.txt'/>
<error type='cancel' code='500'>transfer failed
<undefined-condition xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<transfer-failed xmlns='http://jabber.org/protocol/url-data'/>
</error>
</iq>
If the receiver refuses to accept the URL, it responds with an "iq-error" with the <transfer-refused/> condition:
Example 10. Receiver does not understand/support URL
<iq type='error' from='receiver@jabber.org/resource' to='sender@jabber.org/resource' id='offer2'>
<url-data xmlns='http://jabber.org/protocol/url-data'
sid='a0'
target='http://pass.jabber.org:8519/thefile.txt'/>
<error type='cancel' code='500'>transfer failed
<undefined-condition xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
<transfer-refused xmlns='http://jabber.org/protocol/url-data'/>
</error>
</iq>
The additional information provided by a particular scheme is OPTIONAL. The additional data is provided as XML in a dedicated namespace, and this namespace SHOULD be declared (with an appropriate prefix) within the <url-data/> element.
Entities receiving a <url-data/> element MAY incorporate this information into the use of the URL as necessary. An entity providing a <url-data/> with scheme-specific information SHOULD NOT assume the receiving entity understands it, even if the receiving entity is capable of processing a URL for that scheme.
The <url-data/> element provides the root structure for providing URL addresses. The element has attribute for the target URL and (optional) stream identifier. It contains content for the optional description, and any and all scheme-specific content.
The attribute "target" contains the URL. This attribute MUST be present, and MUST be a valid URL.
The attribute "sid" contains the stream identifier. While this attribute is optional, its usage is REQUIRED when used with Stream Initiation, and MUST contain the Stream Initiation identifier previously agreed to.
In cases where textual descriptions cannot be provided, this element fullfills this need. It MAY include the "xml:lang" attribute for localization purposes, and its content is the text of the description. Multiple instances of <desc/> MAY be present, but each instance MUST have a different value for "xml:lang" attribute.
To simplify the discussion on error conditions, this document uses the following mapping between namespace URIs and namespace prefixes [6].
| Prefix | URI |
|---|---|
| xmpp | urn:ietf:params:xml:ns:xmpp-stanzas |
| url | http://jabber.org/protocol/url-data |
Below are the errors that can result.
Table 2: Error Conditions/Codes
| Error Type | General Condition | Specific Condition | Description |
|---|---|---|---|
| modify | <xmpp:bad-request/> | <url:malformed-url/> | The URL is not supported or understood. |
| cancel | <xmpp:not-acceptable/> | <url:transfer-refused/> | The URL transfer failed for some unspecified reason. |
| cancel | <xmpp:undefined-condition/> | <url:transfer-failed/> | The URL transfer failed for some unspecified reason. |
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='http://jabber.org/protocol/url-data'
xmlns='http://jabber.org/protocol/url-data'
elementFormDefault='qualified'>
<xs:import namespace='http://www.w3.org/XML/1998/namespace'
schemaLocation='http://www.w3.org/2001/xml.xsd'/>
<xs:element name='url-data'>
<xs:complexType>
<xs:sequence>
<xs:any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
<xs:element ref='desc' minOccurs='0' maxOccurs='unbounded'/>
</xs:sequence>
<xs:attribute name='target' type='xs:anyURI' use='required'/>
<xs:attribute name='sid' type='xs:string' use='optional'/>
</xs:complexType>
</xs:element>
<xs:element name='desc' type='xs:string'>
<xs:complexType>
<xs:attribute ref='xml:lang' use='optional'/>
</xs:complexType>
</xs:element>
<xs:element name='malformed-url'/>
<xs:element name='transfer-failed'/>
<xs:element name='transfer-refused'/>
</xs:schema>
This document does not yet have any security considerations.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [7].
The XMPP Registrar [8] shall register the namespace "http://jabber.org/protocol/url-data" as a standard namespace. Also, the XMPP Registrar shall register the Feature Negotiation [9] option "url-data" for use with Stream Initiation.
Series: XEP
Number: 0103
Publisher: XMPP Standards Foundation
Status:
Deferred
Type:
Standards Track
Version: 0.4
Last Updated: 2004-01-20
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0095, RFC 3986
Supersedes: None
Superseded By: None
Short Name: url-data
Source Control:
HTML
This document in other formats:
XML
PDF
Email:
linuxwolf@outer-planes.net
JabberID:
linuxwolf@outer-planes.net
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Given that this XMPP Extension Protocol normatively references IETF technologies, discussion on the <xsf-ietf@xmpp.org> list might also be appropriate.
Errata can be sent to <editor@xmpp.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. RFC 3986: Uniform Resource Identifiers (URI): Generic Syntax <http://tools.ietf.org/html/rfc3986>.
2. XEP-0095: Stream Initiation <http://xmpp.org/extensions/xep-0095.html>.
3. XEP-0104: HTTP Scheme for URL Data <http://xmpp.org/extensions/xep-0104.html>.
4. XEP-0060: Publish-Subscribe <http://xmpp.org/extensions/xep-0060.html>.
5. The error conditions for SI are fully-documented in that document, and are therefore not included here.
6. This mapping is for the purpose of simplifying this discussion, and is not intended to be used in the actual protocol.
7. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
8. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <http://xmpp.org/registrar/>.
9. XEP-0020: Feature Negotiation <http://xmpp.org/extensions/xep-0020.html>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
END