向ISSSSAS提出XMLADAX请求

问题描述 投票:4回答:1

我在SSAS 2019中有一个表格数据库,其中数据源是SQL Server 2019。我需要通过XMLA来检索数据,所以我按照 本说明 来连接IIS和SSAS。

当我通过ISS用POST方法(HTTP调用)向SSAS发送一个SOAP请求时,我得到了下面的错误。事实上,响应是SOAP消息,这让我认为问题出在SSAS,而不是ISS。

如果我从SSMS运行XMLA(不使用SOAP),它可以正常工作,所以可能是SOAP包络的问题。

我试着去google错误,但找不到任何东西。如何使这个工作?这个解析错误是什么?

<?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>

错误的响应。

 <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

请看第2.1.1节中的内容。SSAS规范, DIME代表一个二进制数据记录,不知道为什么SSAS要读取二进制数据。

例如,如果我没有发送整个SOAP XML,而是发送了 <A>xxx</A> 我得到了同样的错误,因为它仍然试图解析DIME格式。

sql-server xml soap ssas dax
1个回答
0
投票

我找不到解决这个问题的方法,所以我最终用C#创建了一个托管在IIS中的REST API服务。C#程序访问Analysis Services数据库,执行DAX语句,并返回一个包含数据的JSON。Java程序调用API获取数据。这种解决方案还有一个额外的好处,因为XMLA过于啰嗦,而JSON消息比较短。即使是大量的数据,这样也能正常工作。

© www.soinside.com 2019 - 2024. All rights reserved.