We used this (http://support.sas.com/kb/25/959.html) article to guide us through building an ASP.NET web service using SAS 9.1.3 integration technologies API to call a stored process. Our web service has the following three simple steps -
1. Creates a temporary FileRef on FileService object & sends an XML file as the input to the TextStream. And finally set the LibRef using DataService object.
2. Executes the stored process using LanguageService.StoredProcessService.Execute (...)
3. Reads the output produced by the sproc which is in a SAS dataset.
To the best of our knowledge and from the ASP.NET webservice article mentioned above, we've configured the service and things look good. But here's the error we get on execution: (this is pulled from SAS logs)
ERROR: File WEBSVC.ICOM.DATA does not exist.
WEBSVC above is the name we assigned to the File in FileRef and to the library in LibRef. ICOM is the root node of the XML document which is streamed in. The stored procedure is coded to look at the dataset "WEBSVC.ICOM". We are not able to figure out what step we are missing here. It sure doesn't look like a whole to get this to work.
Here's how the input XML looks like -
Appreciate any thoughts/inputs,
Message was edited by: SDarbha
Message was edited by: SDarbha
Alright, after little bit more reading and giving a closer look, I found the solution to the error. The problem is that the XML I'm sending in does not exactly match the format of the XML specified in the article. As you can see in my previous post, my input XML has a root node and bunch of child elements, where the root node is the name of the table and the child elements are the columns.
But it doesn't look like its enough - which means, there should be a root node for "dataset" name in the XML which contains multiple table nodes. So in summary, I think the format of the XML that's sending into the stream for stored process should be -
... (like this you can add multiple tables)
Once I added a root node to my XML, it started working as expected, which means the stored process was able to find the dataset WEBSVC.ICOM where ICOM my table name.
There's one more catch here - It worked first time and the second time it threw an error - "Invalid Logical Name". This was happening at the time of assigning FileRef with the name "WEBSVC". This is because the FileRef was assigned earlier is not currently available. So, this means once the sproc execution is done, we should release it for the next guy in the queue.
Once I used DeassignFileRef(...) and DeassignLibRef(..) methods on FileService and DataService respectively, the "invalid logical name" error went away.
I really hoped these important catches were explained well in the documentation. But I thought I would share it incase anyone else runs into this.
Yes, I was referring to XMLA web services. It is part of Integration Technologies, so if you are using WorkspaceManager then you likely already have a license for BI Web Services. You can contact your SAS Representative for the download.