05-26-2017 11:38 AM
I'm developing a Web Application (in ASP.NET Core) that is using SAS Bi Web Services to leverage Stored Processes. I'm having trouble passing data tables between the webapp and SAS.
I managed to load a table from SAS using the HTTP GET request.
Now I'm stuck to SENDING data back to SAS. I'm using SOAPui to test the HTTP POST call in order to figure out what is wrong.
first thing first. The Stored Process is very simple. Take the data stream and write it in a SAS library
%STPBEGIN(debug=y); libname instream XML; DATA test; SET instream.product; run; %STPEND(debug=y);
I set up instream as Data Source XML based data.
I create an XML string from my WebApplication by serializing the model. I have
<?xml version="1.0" encoding="utf-16"?><Value xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <TABLE> <PRODUCT><ProductID>1</ProductID><Name> palla </Name><Description> nike </Description><Category> calcio </Category><Price>10</Price></PRODUCT> <PRODUCT><ProductID>2</ProductID><Name> racchetta </Name><Description> head </Description><Category> tennis </Category><Price>100</Price></PRODUCT> </TABLE> </Value>
If I sent the HTTP post request I get the error
"The request sent by the client was syntactically incorrect"
I tryed both content-type text/xml and application/xml (what's the difference by the way?) If i strip the xml properties on top and leave only <Value> i get a WSException: "Expected stream 'instream' was not specified."
Can you help me? There is very little documentation about this.
06-05-2017 10:31 PM