BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sriramsahani
Fluorite | Level 6

Hi All,

 

Do we have step by step procedure to create a SAS Web service using SAS stored process and how do we call it ?

 

Regards,

Sriram Sahani

1 ACCEPTED SOLUTION

Accepted Solutions
AllanBowe
Barite | Level 11

Another (perhaps simpler) approach is to write out your content directly from an STP to `_webout` and call it using YOURURL/SASStoredProcess/do?_program=/your/path/to/your/stp

 

STPs can be created very easily, eg with the following macro:  https://github.com/sasjs/core/blob/main/meta/mm_createwebservice.sas

 

Some useful resources:

 

 

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs

View solution in original post

2 REPLIES 2
Anand_V
Ammonite | Level 13

Hi @sriramsahani,

 

Thanks for asking this question. I tried to explore on this topic. I am sure you would have gone through the offical documentation of SAS for using BI Web Services. If not, here is the link to that: http://support.sas.com/documentation/cdl/en/wbsvcdg/64883/HTML/default/viewer.htm

Using this as ref. I was able to create a Web Service and view it via browser. I will later try to use Java to call this web service.

 

However for now I listing down the basic steps I have performed.

1) Create a STP for ex: MySTP and store it in your Metadata folder /MyTestFolder/MySTP
I added simple SAS code to the STP as below:

proc print data=sashelp.cars;
run;

2) Launch SMC and go the metadata folder location where you have stored your STP in Step 1.
3) Right click on MySTP and select deploy as Web service. It will ask you to give a name for your web service. lets call it MyWebService.
4) Select the default Web Service Markup URL from drop down and Hit Next. Leave the namespace as default. Incase you want to give a namespace, you can give it here. Click Next
5) Review the details and Hit Finish. This would deploy your web service to location /System/Services/MyWebService.
6) Go to browser and hit the URL: http://<SAS-Mid-Tier-Host-Name-Here>:7980/SASBIWS/rest/MyWebService/MySTP/dataTargets/_WEBOUT
7) If asked for Login, please provide LoginID/Pass which would have permissions to read the STP metadata.

 

Note: Your SAS Environment needs to be deployed with SAS BI Web Services for Java 9.4 in order to make this run. you can validate if this is installed in your environment or not by navigating to SMC -> Plugins -> Application Management -> Configuration Manager -> SAS Application Infrastructure -> BI Web Services for Java 9.4

 

HTH, Thanks!

 

AllanBowe
Barite | Level 11

Another (perhaps simpler) approach is to write out your content directly from an STP to `_webout` and call it using YOURURL/SASStoredProcess/do?_program=/your/path/to/your/stp

 

STPs can be created very easily, eg with the following macro:  https://github.com/sasjs/core/blob/main/meta/mm_createwebservice.sas

 

Some useful resources:

 

 

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 748 views
  • 1 like
  • 3 in conversation