*

Object Reference URLs

This note documents our suggested mapping of URLs to object references. The purpose of this mapping is to have a human readable and writable string representation of object references. It should be possible to automate the conversion of the URL specification of an object reference into a CORBA stringified object reference. Therefore, it should also be possible to automate the conversion into an IIOP IOR (wire form of an object reference).

It is our intension that Object Reference URLs (O_URLs) follow standard URL syntax specifications. I am using the description given in the Internet Draft 06 of the Hypertext Transfer Protocol -- HTTP/1.1 (July 3, 1996). (An excerpt of this document is at the end of this note.) The basic scheme is to encode the following information in a URL.

Scheme
Names the protocol that should be used to contact the server of the object. Currently we are only considering http, and iiop. http would imply that the object is served by an object server that supports http requests (after connecting to the server via http the communication may be shifted to iiop if the client and server support this). iiop would imply that the object is served by a server that only supports iiop requests.

We might also want to consider supporting an ldap scheme that would mean that the object is registered with an LDAP directory server. I will discuss the mapping for this scheme below.

Host
Names the server machine where the server resides. This is subject to the same kind of low-level generalization that host names are in any URL (i.e., ip-redirection, sprayers, etc.).
Server
The names the program (Netscape server-applet, cgi-bin program, IIOP server application, ...) that will contain the activation of the object.
Port
This names the communications port to use to contact the server, it is optional and normal defaults apply.
Object interface
The is a Java interface name (e.g., COM.ibm.mypackage.MyInterface) the defines the minimum interface that the client using the reference would expect to get. This is including in the URL so that client runtimes can build proxies and such without either access to a global type directory or contact with the server. This can also be used by the server for detecting errors.
Object key
The is a string that the server can map to the object activation.
Method
This is an optional part of the URL. It allows the O_URL to contain the specification (name and parameter values) for a method to be invoked on the object. This would, for example, allow an http request to include a method call and therefore avoid an extra client/server round trip on the first contact to a server.
We suggest that these pieces of information be encoded in a form like:

  <scheme>:<host>/<server>:<port>;<object key>?
              <object interface>:<method>

The BNF for this is given in the following section. For LDAP scheme requests we might want to replace the <server> part with a LDAP key that names the server. Then the URL would be used to generate an LDAP request which would return <scheme>, <host> and <server> parts which could be used to construct a <http> or <iiop> URL for the object. For example:

  ldap:<ldap host>:<ldap port>/<ldap server key>;<object key>?
            <object interface>:<method>
would become (after resolving the <ldap server key> with the <ldap host>:<ldap port> server):

  <returned scheme>:<returned host>:<returned port>/<returned server>;
            <object key>?<object interface>:<method>

BNF for Object URLs

Object URIs (O_URIs) are extensions to the general URIs as defined at the end of this document. Any undefined symbols in the syntax definition below refer to the symbols as defined in the reference section on general URLs at the end of this note or to symbols defined in Internet Draft 06 of the Hypertext Transfer Protocol -- HTTP/1.1 (July 3, 1996). All symbols introduced in this extension begin with "O_" or "o_".

URLs are just URIs with a scheme attached at the begriming. Right now we are only considering the schemes http and iiop, and maybe ldap.

A description of the BNF notation is also given in that document. (Note: "#" in front of a symbol means repeat it in a comma separated list.)


   O_URI = o_relativeURI

   o_relativeURI   = o_net_path | o_abs_path | o_rel_path

   o_net_path       = "//" net_loc [ o_abs_path ]
   o_abs_path       = "/" o_rel_path
   o_rel_path       = [ path ] [ ";" o_key ] [ "?" o_i_m ]

   o_key	    =  o_root_key | o_rel_key]

   o_root_key       = ["/"] o_rel_key
		       ; Root keys are absolute keys within the
		       ; activation context of the client's
		       ; connection the the server

   o_rel_key        = o_key [ "/" o_key ]
		       ; Relative keys are relative keys within
		       ; the activation context of the client's
		       ; connection to the server

   o_key	    = 1*pchar

   ; We might want to consider global root keys with a syntax like:

   ; o_global_key   = "//" o_rel_key
		       ; This would mean relative to some global
		       ; directory (such as a LDAP server
		       ; directory), but I am not sure that we
		       ; need this as that is what the full URI is.

   o_i_m            = [interface_name ":"] [ o_method_call ]

   o_interface_name = o_string
   
   o_method_call    = o_regular_m_call | o_nv_m_call

   o_regular_m_call = o_method_name "(" [ #o_parm_value ] ")"

   o_method_name    = o_string

   o_parm_value     = o_string
   
   o_nv_m_call      = 1#( o_nv_name : o_nv_value )

   o_nv_name        = o_string

   o_nv_value       = o_string

   o_parm	    = o_string

   o_char	    = ALPHA | DIGIT | o_safe | national | escape

   o_safe           = "$" | "_" | "."
                       ; The safe characters without "-"

   o_string         = 1*o_char

Examples

Net path:

  //w3.austin.ibm.com/java-applet/Banking
      ;/AustinAccounts/78654987
      ?COM.ibm.jaws.models.Account:deposit(100.00)

Abs path:

  /java-applet/Banking
      ;/AustinAccounts/78654987
      ?COM.ibm.jaws.models.Account:deposit(100.00)

Rel path (relative to the same servlet)

      ;/AustinAccounts/78654987
      ?COM.ibm.jaws.models.Account:deposit(100.00)

Each of these specifies calling "deposit(100.00)" on the object "78654987" in the collection "AustinAccounts" in the root activation context of the Java servlet "Banking".

An object reference without a method call relative to the name context of the server connection.


  ;CheckingAccount?COM.ibm.jaws.models.Account:

This assumes that the servlet defines a default "CheckingAccount".

Reference

Excerpt from "Internet Draft 06 of the Hypertext Transfer Protocol -- HTTP/1.1 (July 3, 1996). The latest spec is: HTTP/1.1 - Proposed Standard.


3.2 Uniform Resource Identifiers

URIs have been known by many names: WWW addresses, Universal Document
Identifiers, Universal Resource Identifiers , and finally the
combination of Uniform Resource Locators (URL)  and Names (URN). As far
as HTTP is concerned, Uniform Resource Identifiers are simply formatted
strings which identify--via name, location, or any other characteristic-
-a resource.


3.2.1 General Syntax

URIs in HTTP can be represented in absolute form or relative to some
known base URI, depending upon the context of their use. The two forms
are differentiated by the fact that absolute URIs always begin with a
scheme name followed by a colon.

       URI            = ( absoluteURI | relativeURI ) [ "#" fragment ]

       absoluteURI    = scheme ":" *( uchar | reserved )

       relativeURI    = net_path | abs_path | rel_path

       net_path       = "//" net_loc [ abs_path ]
       abs_path       = "/" rel_path
       rel_path       = [ path ] [ ";" params ] [ "?" query ]

       path           = fsegment *( "/" segment )
       fsegment       = 1*pchar
       segment        = *pchar

       params         = param *( ";" param )
       param          = *( pchar | "/" )

       scheme         = 1*( ALPHA | DIGIT | "+" | "-" | "." )
       net_loc        = *( pchar | ";" | "?" )

       query          = *( uchar | reserved )
       fragment       = *( uchar | reserved )

       pchar          = uchar | ":" | "@" | "&" | "=" | "+"
       uchar          = unreserved | escape
       unreserved     = ALPHA | DIGIT | safe | extra | national

       escape         = "%" HEX HEX
       reserved       = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+"
       extra          = "!" | "*" | "'" | "(" | ")" | ","
       safe           = "$" | "-" | "_" | "."
       unsafe         = CTL | SP | <"> | "#" | "%" | "<" | ">"
       national       = 

For definitive information on URL syntax and semantics, see RFC 1738 [4]
and RFC 1808 [11]. The BNF above includes national characters not
allowed in valid URLs as specified by RFC 1738, since HTTP servers are
not restricted in the set of unreserved characters allowed to represent
the rel_path part of addresses, and HTTP proxies may receive requests
for URIs not defined by RFC 1738.

The HTTP protocol does not place any a priori limit on the length of a
URI. Servers MUST be able to handle the URI of any resource they serve,
and SHOULD be able to handle URIs of unbounded length if they provide
GET-based forms that could generate such URIs. A server SHOULD return
414 (Request-URI Too Long) status if a URI is longer than the server can
handle (see section 10.4.15).

  Note: Servers should be cautious about depending on URI lengths
  above 255 bytes, because some older client or proxy implementations
  may not properly support these lengths.


3.2.2 http URL

The "http" scheme is used to locate network resources via the HTTP
protocol. This section defines the scheme-specific syntax and semantics
for http URLs.

       http_URL       = "http:" "//" host [ ":" port ] [ abs_path ]

       host           = 

       port           = *DIGIT

If the port is empty or not given, port 80 is assumed. The semantics
are that the identified resource is located at the server listening
for TCP connections on that port of that host, and the Request-URI for
the resource is abs_path. The use of IP addresses in URL's SHOULD be
avoided whenever possible (see RFC 1900 [24]). If the abs_path is not
present in the URL, it MUST be given as "/" when used as a Request-URI
for a resource (section 5.1.2).


Author: Mike Conner, mikec@austin.ibm.com