Can Javascript (AJAX) be used to send a SOAP request to the Statistica web server to execute an analysis configuration and return a spreadsheet result ?

Can Javascript (AJAX) be used to send a SOAP request to the Statistica web server to execute an analysis configuration and return a spreadsheet result ?

book

Article ID: KB0076326

calendar_today

Updated On:

Products Versions
Spotfire Statistica 13.0 and later versions

Description

Javascript can be used to send SOAP requests to Statistica Web Server/Live Score to execute an analysis configuration and return the spreadsheet as a csv.This article contains an example .html file that will use Javascript and send SOAP requests to Statistica Web Server/Live Score to execute an analysis configuration and return the spreadsheet as a csv.

NOTE: The purpose of the article is just to show an example of how WebStatistica/Live score can be customized and is as such not ready to be used in production

Passing credentials programmatically is disabled, defaulting to V13.x compatibility. V13.x supports browser-based Basic Auth; V14.x adds ability to programmatically send credentials.
NOTE regarding CORS (Cross Origin):
IE will show login dialog in cross-origin situations; Chrome/Firefox won't - in which case make sure this HTML is served from the same domain as the Live Score service it is calling (same domain also means same protocol and port number), which might require installing URL Rewrite / ARR addin into IIS and setting up reverse proxy from /LiveScore to localhost:8081/LiveScore

Hence IE is the preferred browser to run this example. 

Issue/Introduction

This article contains an example .html file that will use Javascript and send SOAP requests to Statistica Web Server/Live Score to execute an analysis configuration and return the spreadsheet as a csv.

Resolution

To run this example :
1. Create a local user on the WebStatistica/LiveScore Server named score and import the user into Enterprise Manager
2. Copy the attached ScoringTest.svb script to [drive]:\WebSTATISTICAPub\RepositoryRoot\System\Scripts
3. Deploy the Attached workspace ScoringTest.sdm to Statistica Enterprise Manager as an Analysis.
4. Open the .html, modify the Deployment path, the name of the script and modify server name and port if need be and then click on the Call LiveScore button.

User-added image

The workspace simply outputs a few columns .The html has an example of request to run Analysis being  the output spreadsheet is output as a comma separated records along with Workspace dictionary items. 
 

Attachments

Can Javascript (AJAX) be used to send a SOAP request to the Statistica web server to execute an analysis configuration and return a spreadsheet result ? get_app
Can Javascript (AJAX) be used to send a SOAP request to the Statistica web server to execute an analysis configuration and return a spreadsheet result ? get_app
Can Javascript (AJAX) be used to send a SOAP request to the Statistica web server to execute an analysis configuration and return a spreadsheet result ? get_app