Hi Experts,
I have created a stored process with input and output parameters that I'm trying to call using SAS BI Web Services. See the SAS stp code below:
*ProcessBody;
%global BANK
CALCULATIONTYPE
COMPANYID
CUSTOMERID
MODELCODE
PREVIOUSCALCULATIONDATE
PREVIOUSEXPECTEDLOSS
PREVIOUSLOSSGIVENDEFAULT
PREVIOUSPROBABILITYOFDEFAULT
QUESTIONNAIREGRADE;
%STPBEGIN;
* End EG generated code (do not edit this line);
proc printto log=" D:\RiskModels\RestLogs\web_service_test_%sysfunc(today(),yymmdd10.)-%sysfunc(compress(%sysfunc(time( ),time.),":")).log";
run;
libname srcdata "D:\RiskModels\SourceData";
proc sql noprint;
select distinct Client_LGD format=16.8 into :lgd from srcdata.lgd_table where
ID =&customerID;
quit;
%let probabilityOfDefault=0.5;
%let lossGivenDefault = &lgd;
%let expectedLoss = %sysevalf(&lgd. * &probabilityOfDefault.);
%let commentCodes = 1,2,3;
* Begin EG generated code (do not edit this line);
;*';*";*/;quit;
%STPEND;
* End EG generated code (do not edit this line);
I'm using Postman to call the stored process in POST method. My endpoint is (I omitted the server name for this example):
https://server:443/SASBIWS/json/storedProcesses/RiskModels/web_service_test
The format of the request is JSON. See an example of a request below:
Body:{"bank":"bank_name","customerID":"12345678","companyID":"12345678","calculationType":"1","modelCode":"111","questionnaireGrade":70.5,"previousCalculationDate":"2022-08-09","previousProbabilityOfDefault":0.6,"previousLossGivenDefault":0.5,"previousExpectedLoss":0.3}
When I'm sending the JSON request with the header: "Content-Type: application/json "
the response is: "HTTP Status 415 – Unsupported Media Type".
My request never reaches the storedprocess server, it gets an error from the webserver.
So I guess my question is: What is the correct way to call SASBIWS in POST method using a JSON request.
Thank you very much,
Nufar.