Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

xml over https via GET request

Featured Replies

Hi

Can anyone give me a clue here?

I have constructed a type of shopping cart solution using CWP (FM 7).

In talking with a payment gateway company, they can process the payment via a GET request and return xml (I'll need to use xslt to transform it into FMPXMLRESULT.

My problems...

1. FileMaker can't import xml from https data sources.

2. You can't trigger an xml import script from CWP.

Has anyone else tried this (successfully) or am I wasting my time?

Don't think in scripts, you can do everything with XSLT custom web publishing.

You can use the XSLT document() function to retrieve the XML data from the remote web server and store it in a variable. According to the CWP Guide document() should work with https.

Then you can extract the needed values from the variable with XSLT.

With another document() function you can populate your database with the values with -edit or -new queries.

This can all be done in one XSLT stylesheet.

Martin

  • Author

Thanks Martin

I have to send the payment info via a GET url request. So I load the url string into a document function. Is that what you are saying?

Do I use "xsl:value-of select..." statements within the query string or do I have to create variables for all the customer details (so $customer-name, etc)?

Thanks for your help.

<xsl:variable name="payment" select="document('https://www.eway.......[the rest of the query string]')"/>

I have to send the payment info via a GET url request. So I load the url string into a document function. Is that what you are saying?

Yes. Your code below is in the right direction.

Do I use "xsl:value-of select..." statements within the query string or do I have to create variables for all the customer details (so $customer-name, etc)?

No, you don't need the xsl:value-of select within document.

I assumed that you already know about the concat() function that can concat strings (see also these threads thread1, thread2)

For the strings you can either use a static string (string within ''), a variable ($customer-name), or an XPath that selects an element of your XML fmresultset node tree (e.g. the part that you would write within the select="" attribute of the <xsl:value-of select="..."> you would use normally.

<xsl:variable name="payment" select="document('https://www.eway.......[the rest of the query string]')"/>

For testing purposes only, you can print then the content of your variable payment to see the XML tree that your payment service had sent back:

<textarea cols="10" rows="80"><xsl:copy-of select="$payment"></textarea>

Then you can address the needed elements either with <xsl:value-of select="$payment/element1/element2/...." or store them in variables (my prefered way) and use the variables in another

<xsl:variable name="feedback_from_fmquery" select="

document(concat('http://localhost/fmi/xml/fmresultset?-db=yourdatabase&-lay=yourlayout&field1=',$variable1,'&-new'))"/> statement or similar (check the syntax if you need -edit in the CWP Guide).

Martin

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.