How to send SOAP request to Live Score Service through SoapUI for scoring with Statistica workspace?

How to send SOAP request to Live Score Service through SoapUI for scoring with Statistica workspace?

book

Article ID: KB0076595

calendar_today

Updated On:

Products Versions
Spotfire Statistica 13.5 and above

Description

This article demonstrates a simple example of sending SOAP request to Statistica Live Score Service through a 3rd party SoapUI tool for prediction/scoring with Statistica workspace. 

Issue/Introduction

How to send SOAP request to Live Score Service through SoapUI for scoring with Statistica workspace?

Environment

Windows

Resolution

1. Download and install 3rd party SoapUI tool from here

2. Please follow steps 1 to 13 in this article : https://support.tibco.com/s/article/How-to-build-a-workspace-with-Input-and-Output-nodes-for-Live-Score-deployment to prepare Statistica workspace with input and output nodes for deployment to Live score. An example workspace is attached with this article.

The workspace generates a PMML model node and the "Rapid Deployment" node will take new input values, run the PMML model and make predictions for new inputs.
The workspace needs to be deployed to Statistica Enterprise, so that Live Score can locate the workspace in Enterprise. 

User-added image

3. Launch SoapUI tool, go to menu "File | New SOAP Project", the "New SOAP Project" dialog pops up. Give a "Project Name" (e.g. CreditRisk)

Statistica provides sample starting WSDL file that users can make use for simple application. We use below sample starting WSDL provided for illustration in this article. 
Click "Browse" to load the sample wsdl file "Live Score Sample.wsdl" (located typically at "C:\WebSTATISTICAPub\RepositoryRoot\System\Scripts") as "Initial WSDL".

User-added image

Click Open and then Click OK. 

4. Under SoapUI Projects list, go to the project created (e.g. "CreditRisk"), find and double click on "Request 1" to load the WSDL request text. 
Execution the WSDL request at this stage will fail. It requires Authentication.

SOAPUI tool supports standard method of authentication and will send the Authentication information to the Live Score Web Service end point. 

Click on “Auth” to add new Authentication of type "Basic":

User-added image


User-added image

To supply this credential, user can go to “Control Panel | Administrative Tools | Computer Management | Local Users and Groups | Users” to create a new local user.
User would need to add this user to be at least member of SWS_USER group, and it is recommended to add this user to Enterprise too in case the user needs to access Enterprise.

User-added image

User-added image
User-added image

5. In the WSDL request text, user needs to give the workspace path in Enterprise for the <WFID> field. This is described in : https://support.tibco.com/s/article/How-to-get-the-system-view-path-of-an-object-in-Statistica-Enterprise-Manager  and also summarized below :
Switch to Enterprise Manager to find the workspace, right click and choose "Copy Path to Clipboard". 
User-added image

Go to SoapUI WSDL text, replace the ? with the workspace path for field <WFID>.

For example :  <WFID>/Jenny/InputOutputNodesForLiveScore</WFID>
User-added image

6. The field "RecordID" is an arbitrary field name for data records in databases. If RecordID exists, it will retrieve the input data record with RecordID from database through the underlying Enterprise data configuration and supply as the input for the workspace to be executed. In this case, one would need to make some special configurations in his Enterprise data configuration.

For the workspace used in this demonstration, the "RecordID" field is not required and we can simply remove the line from the WSDL file.

7. Next, manually add the fields and supply new values for the input variables/predictors required by the PMML model in the workspace.

In the WSDL request, the line should be looks like: <VariableName>value</VariableName>
The variable names have to match exactly with the ones in PMML model and there should not be white spaces within the variable names.

For example, in this demonstration, the predictors required are as below with new values provided:
<Purpose>Business</Purpose>
<Employment>Long</Employment>
<Gender>M</Gender>
<Housing>Own</Housing>
<Job>Skilled</Job>
<Age>38</Age> 

8. The field "ClearCache" has the value of 0 or 1. If it is set to be true with value 1, live score will remove all the models from memory and start from clean state. Cache mode with field value of 0 will make the live score response faster with models kept in memory. 

9. Now we are ready to execute the WSDL request. Click on the green arrow icon on the top left of the menu to send the request. The prediction result based on the new inputs supplied will be returned and displayed in the panel on the right. 
User-added image

User can edit the WSDL request and supply new set of values for the predictor fields for next scoring/prediction. 

Additional Information

https://support.tibco.com/s/article/How-to-get-the-system-view-path-of-an-object-in-Statistica-Enterprise-Manager
https://support.tibco.com/s/article/How-to-build-a-workspace-with-Input-and-Output-nodes-for-Live-Score-deployment
 

Attachments

How to send SOAP request to Live Score Service through SoapUI for scoring with Statistica workspace? get_app