Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making XMLA/DAX requests to ISS/SSAS

I have a tabular database in SSAS 2019, where the data source is SQL Server 2019. I need to retrieve data through XMLA, so I followed these instructions to connect IIS to SSAS.

When I send a SOAP request to SSAS through ISS with a POST method (HTTP call), I get the error below. The fact that the responses are SOAP messages make me think that the problem is in SSAS, not ISS.

If I run the XMLA from SSMS (without SOAP) it works fine, so it may be an issue with the SOAP envelope.

I tried to google errors, but cannot find anything. How to make this work? What is this parsing error?

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 <soap:Body>
    <Execute xmlns="urn:schemas-microsoft-com:xml-analysis">
        <Command>
            <Statement>
                Evaluate DimProduct
            </Statement>
        </Command>
        <Properties>
            <PropertyList>
                <Catalog>TabularProject4</Catalog>
            </PropertyList>
        </Properties>
    </Execute>
 </soap:Body>
</soap:Envelope>

The error response:

 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
     <soap:Body>
        <soap:Fault xmlns="http://schemas.xmlsoap.org/soap/envelope/">
             <faultcode>XMLAnalysisError.0xc1270004</faultcode>
             <faultstring>Errors during parsing DIME headers. An unexpected value was 
 encountered in the TYPE field of a chunk record for a DIME message.</faultstring>
             <detail>
                 <Error ErrorCode="3240558596" Description="Errors during parsing DIME 
headers. An unexpected value was encountered in the TYPE field of a chunk record for 
a DIME message." Source="Unknown" HelpFile=""/>
             </detail>
         </soap:Fault>
     </soap:Body>
 </soap:Envelope>

UPDATE

Look at section 2.1.1 in the SSAS specification, DIME represents a binary data record, not sure why SSAS is trying to read binary data.

For example, if instead of sending the entire SOAP XML I send <A>xxx</A> I get the same error, as it still tries to parse the DIME format.

like image 275
ps0604 Avatar asked May 11 '20 20:05

ps0604


1 Answers

I couldn't find a fix to this problem, so I ended up creating a REST API service in C# hosted in IIS. The C# program accesses an Analysis Services database, executes the DAX statement, and returns a JSON with the data. The Java program gets the data calling the API. There's an additional benefit to this solution, as XMLA is too verbose and JSON messages are shorter. This works fine even with large amounts of data.

like image 165
ps0604 Avatar answered Sep 23 '22 00:09

ps0604