Introduction
Spotfire® allows users to create custom functionalities using scripts in IronPython. Using the below script, users can configure a button that when clicked will call a web service or retrieve a URL. A sample URL that returns JSON values is shown below.
Call Web Service or Retrieve URL
The below script will call a web service or retrieve a URL
# Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license. # Import the necessary packages import clr clr.AddReference('System.Web.Extensions') from System.Web.Script.Serialization import JavaScriptSerializer from System.Net import WebClient # Create a web client client = WebClient() # Specify a resource of type string to download strURL = "http://mywebserveraddress/location/query?format=json"" # Download the results of that URL results = client.DownloadString(strURL) # print these results print results
See Also:
Here is a working example of a fully implemented Web Service integration using IronPython.
License: TIBCO BSD-Style License
Recommended Comments
There are no comments to display.