Your SAS programs, embedded in web apps and elsewhere

Help with SAS RESTful webservice

Contributor DCL
Posts: 40

Help with SAS RESTful webservice



I am currently facing issues while trying to invoke SAS BIWebservice.


I am using Firefox plugin- RESTClient to invoke

https://<webserverUrl>/SASBIWS/rest/storedProcesses/<StoredProcess Path >/<stpName>?<parameter1>=<value1>

However, "parameter1" is not getting resolved in sas.


I had registered the stored process with

* Results capability- enabled for "Stream" and "Package"

* Server Type: Stored process only

* Prompts: <parameter1> type: text


The purpose of this stored process is to stream a PDF file to the browser.


Any help on this topic would be highly appreciated:

1. I am currently puzzled why the parameter is not getting resolved.

2. How do I access the WADL file for this webservice

WSDL path is as follows:

https://<webserverUrl>/SASBIWS/services/<StoredProcess Path >/<stpName>.wsdl


Please let me know if there are any questions.


Thanks in advance,


Contributor DCL
Posts: 40

Re: Help with SAS RESTful webservice

latest Update:

I managed to pass the parameter as Body in the RESTClient and it worked:




But, now it fails in SAS as I had given fileref as _WEBOUT in the code- SAS tries to write _webout.dat in the SAS Foundation library where it doesnt have write access.


MPRINT(FSTREAM):   data _null_;
MPRINT(FSTREAM):   infile ".../saswork/SAS_work470C0026F545_sla06469/SAS_work8ECA0026F545_sla06469/temp.csv" recfm=f lrecl=1;
MPRINT(FSTREAM):   file _WEBOUT recfm=n;
MPRINT(FSTREAM):   input c $char1. @@;
MPRINT(FSTREAM):   put c $char1. @@;



Now, I am wondering if I have to define "Data Targets" for this stored process.


Any suggestions?

Posts: 304

Re: Help with SAS RESTful webservice

Do you have Stream selected as a result type in your stored process defintion?


Vince DelGobbo


Contributor DCL
Posts: 40

Re: Help with SAS RESTful webservice

Posted in reply to Vince_SAS

Thanks Vince for the response- I did mention the Stream option. In the meantime, I fixed my issues.


Just in case, it helps anyone - I am listing down the mistakes/ corrections I made during the last couple of days:

1. After getting annoyed with _WEBOUT, I decided to use another fileref in my SAS code and registered that in Data target tab while creating the stored process (Once I find some time, I will recheck _WEBOUT again- conceptually it should work- i guess!)

2. I spent some hours to realise that the endpoint URl is different for getting the Streamed results/ Output parameters

eg. https://<webserverUrl>/SASBIWS/rest/storedProcesses/<StoredProcess Path >/<stpName>/outputParameters/<macrovariable>

https://<webserverUrl>/SASBIWS/rest/storedProcesses/<StoredProcess Path >/<stpName>/dataTargets/<fileref>

3. In dataTargets, it took me some time to configure the correct content-type for associated file

File Type
pdf application/pdf
xls/csv application/
 zip  application/x-zip-compressed

4. At client side, I gave content-type: text/xml as I pass the parameters


There are still lot of areas to explore in this topic. Eventhough, I read about XMLA webservice, i havent still understood its use case. Since RESTClient is easy to use, I felt RESTful webservices comparatively simple to operate.



Ask a Question
Discussion stats
  • 3 replies
  • 2 in conversation