Wednesday, February 04, 2004

Pass by Reference : Answer #2

As previously posted, I've been looking at options for passing by reference. It has been interesting to see how people interpret this question. The first divide occurs in regard to 'what' is being referenced in the pass: pointers to data or pointers to services (or pointers to service that front-end data).

One thing that everyone seems to be agreeing on is that the 'pointer' is the URI. Last night I had a brief discussion with Dave Langworthy of Microsoft. Dave confirmed a couple of things. 1. There is no WS-EndpointReference specification, the portions of that spec that were relevant were rolled into the WS-Addressing specification. 2. I can accomplish what I want by using the endpoint reference functionality.

This threw me for a loop, mostly due to my lack of knowledge on this spec. Dave went on to explain that there are two primary pieces of the WS-Addressing specification:
1. The Message Header - This gives the from/to info for the header of the SOAP envelope
2. Endpoint References - This points to resources; these resources could be data, processors or other. Also, the Endpoint Reference is a 'type' which can be used in the body of a soap message. This means that you would define your WSDL 'message part' using an Endpoint Reference as the 'type' of a 'part'.

Within the 'EndpointReference' structure, there are a couple items of interest:
1. 'Address' - This is the URI of the data that you want to reference (or the actual endpoint referencing a service that gives you access to the data)
2. 'Reference Properties' - This is the bucket where you add qualifiers to zero-in on the information you are looking for. In my case, it will likely be an XPath expression that points to a specific element in an XML schema.

Summary - you can use an endpoint reference as standard type to act as a pointer to a resource. This standardized type can be leveraged inside of your own messages.

Sidenotes:
- The Address could specify a 'virtual' address that performs further resolution
- The Address could point to the URI of 'localhost' enabling pass-by-reference in local mode
- I'm not sure if there is a standardized way to drop in an XPath expression in a ReferenceProperty (anything special?)
- If the Address is referencing an XML document don't expect locking / synchronization, etc.

No comments: