Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Http request


This topic is 6205 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I'm sorry to be rather noobish at this subject. I need to do a http request with filemaker (8.5) and through this request communicate with xml.

How can i do this?

Posted

You submit an http request, using a URL path as the xml path, generally to a web service that will return the data as xml. You can import this data directly into FileMaker, using the Import XML command. But you must "transform" the xml data into the structure and syntax that FileMaker wants for importing; that's what the xsl file does. But you have to custom write the xsl to match the xml.

XML means "Extensible Markup Language" (I think). Extensible means you can write any kind of structure you need to fit and enclose your data, as long as you follow the rules. Which means no two people are likely to write exactly the same structure. Much like a FileMaker database, but even more so. It is NOT a "format", like tab-delimited or comma-delimited, which are essentially "flat" structures. An XML file can contain a quite complex hierarchal structure. It could contain the data for many different FileMaker tables in one text file. That's quite an accomplishment. But FileMaker needs to be told what everything is, and what data you want. And it has to be told this in a structure that FileMaker understands.

Do a search here and look at a few examples, to get a general idea about the structure FileMaker requires for an xml import.

Since you're on a Mac, I'll tell you a simple way to see what the xml you're downloading looks like. Use AppleScript to download as is (or use Safari and save the Source view; Safari does not show you the xml like Internet Explorer does; which is "correct" behavior? Heck if I know :)-]

Run the below in the Script Editor application:

do shell script "curl 'http://www.weather.gov/data/current_obs/KSAN.xml' -o ~/Desktop/KSAN_weather.xml"

It will return the local weather for San Diego's Lindbergh Field airport and write it as an xml text file to your Desktop. Substitute the URL for your xml instead, and it will write yours (you can change the file name at the end).

The point of all this is that you (or us) cannot write the xsl required to import xml into FileMaker until you see what the xml looks like, in a file. Using only trial and error importing into FileMaker directly is a painful way to learn. Use a real xml/xsl transformation application to build and test.

Posted

Hi Fenton,

Thank you. For importing the data this will work. However, I dont need to import data into filemaker yet, I need to export my FM-data to an external http server/service with XML using the so called http request(?).

I already have defined the output (using xsl to transform the export from filemaker into a correct xml. The next step should be that this xml can be uploaded or preferably exported directly to this http service.

it should work on mac / xp

Hope you can help me further. Thanks in advance.

Posted

I believe what you could do that by just exporting the xml locally, then uploading via FTP. Which would require a plug-in or (free) command line (such as 'curl' on Mac, 'wget' on Windows).

This topic is 6205 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.