XEP-0103: URL Address Information

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 - 2014 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.


Table of Contents


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


1. Introduction

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]).

2. Requirements

The requirements this protocol fulfills are:

3. Use Cases

3.1 "Publishing" URLs

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 (XEP-0104) [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 (XEP-0060) [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>
    

3.2 SI Usage

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]:

  1. The sender makes a SI request, adding "http://jabber.org/protocols/url-data" as one of the "stream-method" features.
  2. The receiver accepts the SI request, and selects "http://jabber.org/protocols/url-data".
  3. The sender provides an <iq/> with the <url-data/>.
  4. The receiver retrieves the data from the provided URL [E1, E2].
  5. Once retrieval is complete, the Receiver responds to Sender (EUC).

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:

Example 5.

<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>
    

4. Implementation Notes

4.1 Schemes

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.

5. Formal Description

5.1 <url-data/> Root Element

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.

5.2 <desc/> Element

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.

5.3 Error Conditions

To simplify the discussion on error conditions, this document uses the following mapping between namespace URIs and namespace prefixes [6].

Table 1: Namespace Mappings

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.

5.4 XML Schema

<?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>
    

6. Security Considerations

This document does not yet have any security considerations.

7. IANA Considerations

This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [7].

8. XMPP Registrar Considerations

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 (XEP-0020) [9] option "url-data" for use with Stream Initiation.


Appendices


Appendix A: Document Information

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


Appendix B: Author Information

Matthew Miller

Email: linuxwolf@outer-planes.net
JabberID: linuxwolf@outer-planes.net


Appendix C: Legal Notices

Copyright

This XMPP Extension Protocol is copyright © 1999 - 2014 by the XMPP Standards Foundation (XSF).

Permissions

Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <http://xmpp.org/about-xmpp/xsf/xsf-ipr-policy/> or obtained by writing to XMPP Standards Foundation, 1899 Wynkoop Street, Suite 600, Denver, CO 80202 USA).

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) 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.


Appendix E: Discussion Venue

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>.


Appendix F: Requirements Conformance

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".


Appendix G: Notes

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>.


Appendix H: Revision History

Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/

Version 0.4 (2004-01-20)

Reorganized for Editorial preferences; revised error conditions; added better localization for <desc/> (lw)

Version 0.4 (2003-09-30)

Revised <iq/> usage to be "SI" usage (lw)

Version 0.3 (2003-09-19)

More fixes to <iq/> usage; Specified additional error code/condition for refused transfers (lw)

Version 0.2 (2003-07-06)

Fixed <iq/> usage; Specified error codes/conditions (lw)

Version 0.1 (2003-06-30)

Initial version. (lw)

END