Re: concatenating web services

On Wed, Jan 15, 2003 at 11:44:42AM -0500, Sudhir Agarwal wrote:
> imaging you want to know the average temperature of city x on 31st december over the last 20 years.
> there are two web services ws1 and ws2.
> ws1 provides the temperatures and ws2 calculates the average of list of numbers.
> 
> i want to avoid that the client c gets all the temperature data from ws1 which it then sends to sw2 which calculates the average and sends the answer to c.
> i would rather like to tell ws1 somehow (how? that is actually my question) to send its output (list of temperatures) to ws2 and not to c. 
> ws2 must be able interpret it as its input and must know that it should send its output (average) to c and not to ws1.
> 
> i will appreciate any comments and ideas that give me more insight in this matter.

IMO, this is problematic with the current (WSDL-based) approach to Web
services, because each service exposes its own interface which yields
high integration/composition costs.

A Unix-like pipe-and-filter architectural style might help you out here.
So if you had two services that each implemented stdin and stdout, and
shared knowledge of a common data format about temperatures, you could
do;

  $ temperatures -c "Ottawa" | average -last 20 > results.out

Conveniently, Web architecture is similar to pipe-and-filter in this
respect, since all components expose a common, uniform interface[1].  So
you could compose the two services like so;

http://example.com/averages?temp=http://example.org/temp/city/Ottawa

or, by using a temperature-averaging HTTP intermediary on a GET request
to http://example.org/temp/city/Ottawa

 [1] http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm#sec_5_1_5

MB
-- 
Mark Baker.   Ottawa, Ontario, CANADA.        http://www.markbaker.ca
Web architecture consulting, technical reports, evaluation & analysis

Received on Thursday, 16 January 2003 14:50:28 UTC