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:
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.
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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.