
Building Web Services with FileMaker Pro
Introduction
FileMaker Pro 5.5 added the ability to return query results in XML to the existing web interface. Acting as a web server, however, FMPro does not support transforming the returned XML on the server. FileMaker's documentation describes using Internet Explorer's built-in DOM and XSL tools to transform the returned XML for display, which limits the usefulness of the XML data feature since browsers vary in their implementations of XSLT and DOM.
In this article, I will show how I used two PHP implementations of XML tools, RAX and XML-RPC, to create a web interface to a FileMaker Pro database. I'm using these techniques at Apple, where we have many FileMaker databases we need to put on our intranets. Since FileMaker runs on OS X, for a small workgroup solution you can run all the pieces on a single machine combining Apache with PHP and FileMaker.
At Apple, we use FileMaker Pro in small databases maintained by groups throughout the company. Some users need to browse, add, or edit records; and others need to connect to the databases to do analytic work.
Getting XML out of FMPro
Setting Up
Getting XML data out of FileMaker requires the database be set up for web access. In this article I'm using a simple phone list example with three fields:
- Name, a text field
- Phone Number, a text field
- Location, an enumerated type with possible values: Austin, Cupertino, Sacramento
The database is in phonelist.fp5.
FileMaker and the database have to be set up to serve over the Web. Go to the FileMaker application preferences and select the Plug-Ins tab.
|
|
Enable the Web Companion by selecting the line with the option, then checking the box next to it. Then click "Configure...". There are several options here, the only one to worry about in this example is the port number. If you are running FileMaker and OS X's built-in Apache web server on the same computer, you will need to run FileMaker's web server on another port. By convention, FileMaker's web server runs on port 471 [ see FM Documentation ].
|
|
After you enter the port number, and click okay, you will be asked to enter your administrator password under OS X to make system changes.
In my experience with setting up the Web Companion on two computers running OS X, you may receive an error message about having insufficient memory to run the Web Server. In that case, quit FileMaker and restart.
Now set up the phonelist database for the Web. Open the file, and select "Sharing..." from the file menu.
|
|
Select the Web Companion option and check its box. You can disregard "Set Up Views..."
The database and FileMaker Pro are now set up to view queries using HTTP.


