BookmarkSubscribeRSS Feed
Crysis85
Obsidian | Level 7

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.

 

1 REPLY 1
J_Fredlund
Fluorite | Level 6
It sounds like something might not be registered in the metadata correctly. Can you take a look at this example and make sure it's set up similarly?

http://support.sas.com/rnd/itech/doc9/dev_guide/websrvcs/sample.html

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
  • 1098 views
  • 0 likes
  • 2 in conversation