[alicebot-archcomm] Could <services> use a very simple data exchange protocol

Gary Robertson alicebot-archcomm@list.alicebot.org
Wed, 06 Aug 2003 10:08:26 -0400


--=====================_190641765==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

In a day or two, I will have an aiml 'service' operating 
at  http://SystemsCheck.com/aimlservice/ that we can use to further explore 
fetch possibilities.

I hope to have as my first example, a simple 'service' that will return the 
CURRENT TIME in a number of formats.

I see the opportunity to use this test platform to try out a variety of 
data exchange protocols.  One that I am now proposing has its grounding in 
the  'signature' or overlay features found in many programming languages.

The goal of the service will be to return the CURRENT TIME on demand, and 
in the specific format, or formats, specified.  The <service> will support 
security, timezone, usedaylightsavings and up to   3 time output 
formats:  standard, military, and verbal.

The idea is this:   The developer makes a service request by sending a 
string of  'service'-legal ATTRIBUTE=DATA pairs.  Here is an example

<services
           name="currenttime"
           url="http://SystemsCheck.com/aimlservices/currenttime.cfm"
           url2="http://BackupSystem01.com/aimlservices/currentime.cfm" 
<!--optional--->
           url3="http://LastChance.com/aimlservices/currentimte.cfm" 
<!---optional-->
           parameters="userid='myname'"&"userpass='mypass'"&"timezone='eastern'"&usedaylightsavings='yes'"standardformat=''"&"verbalformat=''"&"resultcode=''">


In the example above, 'name 'is defined as anything the developer wants and 
is used for quick reference only.  I cannot resist suggesting that there be 
a primary server with (optionally) up to two backup servers that AIML can 
call upon to supply the request.  Why 3?  Well, triple system redundancy is 
good enough for NASA and already one better than the Internet DNS system, 
so why not?

Implicit in the selection of the pairs above are the details of the 
request, and they must conform to whatever is 'legal' in context for the 
service.

This particular service requires userid and userpass and timezone to be 
supplied.  The input parameter of usedaylighsavings is 'optional' and 
defaults to 'yes' if not specified.  In this example, there were two output 
formats requested; they are standardformat and verbalformat.  The third 
format, militaryformat, was not requested.  By merely supplying the 
attributes of standardformat and verbalformat assigned with anything (in 
this case null string) the request is made.  And although in this example 
'resultcode', a reserved parameter which was requested, it will always be 
returned, requested or not.  We could agree that code 0 (zero) means 
success and any other code is whatever the service developer documents it 
to be.

I would suggest that all services support the reserved parameter: 
help=''   which will cause the return of  help documentation for that 
service.  This way a developer can just directly call up the url and get 
the 'skinny' immediately. For example:

http://SystemsCheck.com/aimlservices/currenttime.cfm?help=""

Based on the request in this example, the service will return the 
appropriate ATTRIBUTE-PAIRS separated by commas.  In this case they would be:

         standardformat="10:22 pm", verbalformat="ten twenty two p. m.", 
resultcode="0"

The AIML interpreter would automatically create corresponding variables (if 
need be) and stuff them with the returned data values.

My largest concern about this protocol has to do with the design of the 
return string above.  Is it too simple to safely parse by the 
interpreter?  Is XML so much better that it is worth the overhead to use it 
instead?

-gr



--=====================_190641765==_.ALT
Content-Type: text/html; charset="us-ascii"

<html>
In a day or two, I will have an aiml 'service' operating at&nbsp;
<a href="http://systemscheck.com/aimlservice/" eudora="autourl">http://SystemsCheck.com/aimlservice/</a>
that we can use to further explore fetch possibilities.<br><br>
I hope to have as my first example, a simple 'service' that will return the CURRENT TIME in a number of formats.<br><br>
I see the opportunity to use this test platform to try out a variety of data exchange protocols.&nbsp; One that I am now proposing has its grounding in the&nbsp; 'signature' or overlay features found in many programming languages.<br><br>
The goal of the service will be to return the CURRENT TIME on demand, and in the specific format, or formats, specified.&nbsp; The &lt;service&gt; will support security, timezone, usedaylightsavings and up to&nbsp;&nbsp; 3 time output formats:&nbsp; standard, military, and verbal.<br><br>
The idea is this:&nbsp;&nbsp; The developer makes a service request by sending a string of&nbsp; 'service'-legal ATTRIBUTE=DATA pairs.&nbsp; Here is an example<br><br>
&lt;services<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp; name=&quot;currenttime&quot;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp; url=&quot;<a href="http://systemscheck.com/aimlservices/currenttime.cfm" eudora="autourl"><font color="#0000FF"><u>http://</a>SystemsCheck.com/aimlservices/currenttime.<a href="http://systemscheck.com/aimlservices/currenttime.cfm" eudora="autourl">cfm</a></u></font>&quot;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp; url2=&quot;<a href="http://backupsystem01.com/aimlservices/currentime.cfm" eudora="autourl">http://BackupSystem01.com/aimlservices/currentime.cfm</a>&quot; &lt;!--optional---&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp; url3=&quot;<a href="http://lastchance.com/aimlservices/currentimte.cfm" eudora="autourl">http://LastChance.com/aimlservices/currentimte.cfm</a>&quot; &lt;!---optional--&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp; parameters=&quot;userid='myname'&quot;&amp;&quot;userpass='mypass'&quot;&amp;&quot;timezone='eastern'&quot;&amp;usedaylightsavings='yes'&quot;standardformat=''&quot;&amp;&quot;verbalformat=''&quot;&amp;&quot;resultcode=''&quot;&gt;<br><br>
<br>
In the example above, 'name 'is defined as anything the developer wants and is used for quick reference only.&nbsp; I cannot resist suggesting that there be a primary server with (optionally) up to two backup servers that AIML can call upon to supply the request.&nbsp; Why 3?&nbsp; Well, triple system redundancy is good enough for NASA and already one better than the Internet DNS system, so why not?<br><br>
Implicit in the selection of the pairs above are the details of the request, and they must conform to whatever is 'legal' in context for the service.&nbsp; <br><br>
This particular service requires userid and userpass and timezone to be supplied.&nbsp; The input parameter of usedaylighsavings is 'optional' and defaults to 'yes' if not specified.&nbsp; In this example, there were two output formats requested; they are standardformat and verbalformat.&nbsp; The third format, militaryformat, was not requested.&nbsp; By merely supplying the attributes of standardformat and verbalformat assigned with anything (in this case null string) the request is made.&nbsp; And although in this example 'resultcode', a reserved parameter which was requested, it will always be returned, requested or not.&nbsp; We could agree that code 0 (zero) means success and any other code is whatever the service developer documents it to be.<br><br>
I would suggest that all services support the reserved parameter: help=''&nbsp;&nbsp; which will cause the return of&nbsp; help documentation for that service.&nbsp; This way a developer can just directly call up the url and get the 'skinny' immediately. For example:&nbsp; <br><br>
<font color="#0000FF"><u><a href="http://systemscheck.com/aimlservices/currenttime.cfm?help" eudora="autourl">http://SystemsCheck.com/aimlservices/currenttime.cfm?help</a>=&quot;&quot;<br><br>
</u></font>Based on the request in this example, the service will return the appropriate ATTRIBUTE-PAIRS separated by commas.&nbsp; In this case they would be:<br><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>standardformat=&quot;10:22 pm&quot;, verbalformat=&quot;ten twenty two p. m.&quot;, resultcode=&quot;0&quot;<br><br>
The AIML interpreter would automatically create corresponding variables (if need be) and stuff them with the returned data values.<br><br>
My largest concern about this protocol has to do with the design of the return string above.&nbsp; Is it too simple to safely parse by the interpreter?&nbsp; Is XML so much better that it is worth the overhead to use it instead?<br><br>
-gr<br><br>
<br>
</html>

--=====================_190641765==_.ALT--