The Wayback Machine - http://web.archive.org/web/19980131211619/http://www.scripting.com:80/frontier5/xml/rpc/xmlSuite.html

Powerful, cross-platform web scripting.


Home Page

The Plan

Pointers

Site Outline

Scripting News

Still Diggin!

Frontier 5 and XML: suites.xml

This suite turns the Windows version of Frontier 5 into an XML remote procedure calling server.

To run this software you need Frontier 5.0b5 or greater and the current root update.

How to install

This page is a fat page containing suites.xml. After moving it into your database, open suites.xml, and run the install script. It initializes Frontier as a web server, and creates a CGI script at user.webserver.cgis.xmlGateway. The XML server interface hooks into the CGI framework thru this script.

It also creates a table at user.webserver.cgis.xmlHandlers and puts a single test handler in the table, getStateName. All other XML handlers must be in this table.

How it works

If you want to see how it works, look in suites.xml.server. First it parses the XML into a table at temp.xmlTable, surrounded by a semaphore so we can process more than one request at a time.

Then it copies the parameters into a table which is passed to a script in the user.webserver.cgis.xmlHandlers table.

The returned result is coerced to a string and returned within a simple XML wrapper.

Listing

Here's a source code listing of the xml.server script:

on server (xmlText)
 local (adrtable = @temp.xmlTable, xtable)
 semaphore.lock (adrtable, 3600)
 new (tabletype, adrtable)
 xml.parser (xmlText, adrtable)
 xtable = adrtable^
 semaphore.unlock (adrtable)
 
 local (i, paramtable)
 new (tabletype, @paramtable)
 for i = 1 to sizeof (xtable.remoteProcedureCall)
 local (adritem = @xtable.remoteProcedureCall [i])
 if string.lower (nameOf (adritem^)) beginsWith "param"
 paramtable.[adritem^.name] = adritem^.value
 
 local (procName = xtable.remoteProcedureCall.procedureName)
 local (adrscript = @user.webserver.cgis.xmlHandlers.[procName])
 
 local (s = "")
 s = s + "<?XML VERSION=\"1.0\"?>\r\n"
 s = s + "<value>" + string (adrscript^ (@paramtable)) + "</value>\r\n"
 return (s)




© Copyright 1996-97 UserLand Software. This page was last built on 1/14/98; 2:34:05 PM. It was originally posted on 1/14/98; 1:46:36 PM. Webmaster: dave@scripting.com.