Your SAS programs, embedded in web apps and elsewhere

Issues with Posting structured XML to Stored Procedure Web service

Reply
Highlighted
New Contributor
Posts: 2

Issues with Posting structured XML to Stored Procedure Web service

Hello,

I am having issues determining a solution for posting XML data through the SAS web service. In particular similar to this nested example:

 

 

<Menu>
 <breakfast_menu>
        <food>
            <name>Belgian Waffles</name>
            <price>$5.95</price>
            <description>Two of our famous Belgian Waffles with plenty of real maple syrup</description>
            <calories>650</calories>
            <isbest>false</isbest>
        </food>
   </breakfast_menu>
 <Lunch_menu>
        <food>
            <name>BLT Sandwich</name>
            <price>$5.95</price>
            <description>Crispy yummy BLT Sandwich</description>
            <calories>650</calories>
            <isbest>false</isbest>
        </food>
   </Lunch_menu>
</Menu>

 

I was able to import a flat XML structure through my web service. Here is a sample flat structure that I was able to pass through:

 

<input>
  <streams>
    <request>
      <Value>
        <Table>
          <indata>
            <identifier>26ece138-08d2-4784-9ca0-d751867d4534</identifier>
          </indata>
          <indata>
            <identifier>26ece138-08d2-4784-9ca0-d751867d4534</identifier>
          </indata>
        </Table>
      </Value>
    </request>
  </streams>
</input>

 

Mainly, I'm wondering how should I defined the XMLMAP to import the XML file through the web service (Note: I used SAS XMLMAPPER to create the XMLMAP but looks it doesn't work). Also, following is the stored procedure SAS code:

 

libname request xmlv2 xmlmap='/sasdata/test/test.map';
libname otstream xml xmlmeta = SchemaData;
proc sql nopritn;
select count(*) into :a from request.indata;
quit;
data otstream.identifier2;
a_____=&a;
RUN;
libname request clear;
libname otstream clear;

 

 

I'm wondering if anyone has come across this issue and if there is any limitations or a workaround for XML with nested information.

your help would be greatly appreciated.

-Kian

Ask a Question
Discussion stats
  • 0 replies
  • 160 views
  • 0 likes
  • 1 in conversation