BookmarkSubscribeRSS Feed
Karthveeryarjun
Fluorite | Level 6

Hi

 

I have a problem where I should receive an XML file as an asynchronous response into my stored process that has been deployed as a web service and save that file on to physical path of SAS grid. In short, system needs to receive an XML file from a different system that will send the XML to the SAS web service URL(URL that's generated after deploying the Stored Process as a web service). The challenge here is I am not able to find a code that captures the XML sent by the other system asynchronously. 

 

To figure this out, I am trying to replicate the example given at https://support.sas.com/kb/63/405.html

But I am getting an error into the XML file which says "The server refused this request because the request entity is in a format not supported by the requested resource for the requested method" inside html code. I believe this is something to worry about the input format but not very sure.

 

I tried to put the below code(as per https://support.sas.com/kb/63/405.html) in my stored process.

 

libname instream xml;
libname outstr xml;

proc copy in=instream out=work;
run;

data outstr.indata;
   set work.indata;
run;  

Also configured the Data sources and targets as below:

STP_WEB.PNG

 

And tried to invoke the web service from Enterprise Guide using proc HTTP as suggested in the example.

 

Could you please suggest me appropriate code to receive the XML sent from different system into the stored process and put the file into a physical location. 

 

Note: The service needs to receive the file whenever the other system sends it via the stored process URL. 

 

1 REPLY 1
Sajid01
Meteorite | Level 14

Try using Proc http.

This has a straight forward answer 
https://communities.sas.com/t5/Administration-and-Deployment/REST-in-webservices-in-sas-9-4-m3/td-p/... 
You can also look to the following for guidance

https://support.sas.com/kb/60/964.html (A set of 4 notes. At the bottom you will have a link to the rest)
https://stackoverflow.com/questions/63336796/how-to-call-a-sas-stp-in-background-using-proc-http-and... 
Please let us know if you have issues

 

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 1 reply
  • 649 views
  • 0 likes
  • 2 in conversation