XMetaL Tips and Tricks
murray November 13, 2009 at 12:09 am
script example: web service call from XMetaL Author scriptNovember 13, 2009 at 12:09 amParticipants 0Replies 1Last Activity 12 years, 10 months ago
The attached file contains an example of how to make a web service call from script in XMetaL Author. For example this could be used make a call to a server to get/put data when the user selects a menu item or clicks on a toolbar button.
Files in the zip:
– copy the testWebService.mcr file to the Startup folder then launch XMetaL Author.
From the comments in the mcr file:
// This macro illustrates how to make a web service call from
// script running in XMetaL Author. For example code like this could be
// invoked from a menu item or toolbar button in XMetaL Author.
// To run this code, put this file in the Startup directory in
// the XMetaL Author installation folder, start XMetaL Author,
// and go to Tools>Macros. In the macro list, select the macro
// named GetTimeFromWebService and then click on the Run button.
// An alert should be displayed that shows the time returned by
// the web service call.
Murraymurray November 17, 2009 at 12:19 am
Reply to: script example: web service call from XMetaL Author scriptNovember 17, 2009 at 12:19 am
So the code should look like this:
var ASYNC = true;
var xmlhttp = new ActiveXObject(“Microsoft.XMLHTTP”);// this is the XMLHttpRequest object
var time = xmlhttp.responseText;
Application.Alert( time );
xmlhttp = null;
- You must be logged in to reply to this topic.