DATA Step, Macro, Functions and more

Read XML with SOAP envelopes

Posts: 0

Read XML with SOAP envelopes


I'll receive a large daily XML file which I want to read in using the XML engine. It seems to read it fine with XMLMapper and successfully displays the Table View of the XML. However when I use the map it generates with the xml libname, it doesn't fail but the table contains no records. The higher level structure of the document is below. The libname engine appears to have difficulty with any elements containing ":" The envolope and body elements refer to SOAP wrappers but the ns3: element is custom.

Any idea why the map successfully used to view a table in XML Mapper does not work when using the libname engine?

Posts: 8,743

Re: Read XML with SOAP envelopes

This really isn't a question for the SAS Macro forum. the XML tagsets used with ODS fall under the ODS forum topics. When you're dealing with XML Mapper and the SAS XML Libname engine, you might want to work with Tech Support -- as the capabilities of both the XML Mapper and the SAS XML Libname engine are version specific. That means the 9.1.3 map and the 9.1.3 engine might have different capabilities than the 9.2 map and the 9.2 SAS XML Libname engine.

You can open a track with Tech Support and they can look at ALL your code and your XML file and help you figure out what's going on.

Generally, in XML when you have a namespace as defined in the XML (such as this namespace declaration from TAGSETS.EXCELXP):
<Workbook xmlns="urn:schemas-microsoft-comSmiley Surprisedffice:spreadsheet"
xmlns:x="urn:schemas-microsoft-comSmiley Surprisedffice:excel"
xmlns:ss="urn:schemas-microsoft-comSmiley Surprisedffice:spreadsheet"

then you can USE the namespace like this in the XML tags in the XML document
<Row ss:AutoFitHeight="1" ss:Height="15">

which uses the AutoFitHeigh and Height attributes from the SS: namespace -- another way of making clear that these attributes are conforming to the specification for xmlns:ss="urn:schemas-microsoft-comSmiley Surprisedffice:spreadsheet" and are probably NOT going to be found in any of the other namespaces listed on the Workbook tag -- in my example.

When you use the XMLMapper, you are building XPATH descriptions of the navigation path that needs to be traversed in the XML in order to turn the XML information into a SAS dataset. Tech Support needs to look at your LOG to see any warning messages that were issued. And, they need to look at your XML and your XML Map code to see whether the correct XPATH was generated when you were using the XML Mapper to build your map.

But, what I don't know and what you also might want to check with Tech Support is whether there's something different you have to do in order to read SOAP XML. For example, there is PROC SOAP, which is designed to read SOAP XML:

To open a track with Tech Support, fill out the form at this link:

Posts: 0

Re: Read XML with SOAP envelopes

OK will do, thanks
Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation