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.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!

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
  • 1 reply
  • 790 views
  • 0 likes
  • 2 in conversation