BookmarkSubscribeRSS Feed
DCL
Obsidian | Level 7 DCL
Obsidian | Level 7

Hi,

 

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,

Dilip

3 REPLIES 3
DCL
Obsidian | Level 7 DCL
Obsidian | Level 7

latest Update:

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

 

<any>
<parameters>
<parameter1>value1</parameter1>
</parameters>
</any>

 

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. @@;
MPRINT(FSTREAM):   run;

 

 

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

 

Any suggestions?

Vince_SAS
Rhodochrosite | Level 12

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

 

Vince DelGobbo

SAS R&D

DCL
Obsidian | Level 7 DCL
Obsidian | Level 7

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
content-type
pdf application/pdf
xls/csv application/vnd.ms-excel
 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.

 

Thanks,
Dilip

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1283 views
  • 2 likes
  • 2 in conversation