SSAS: 如何在客户端程序中调用DISCOVER命令


上次我们提到了如何用DISCOVER命令,查看服务器端的所有会话

<Discover xmlns="urn:schemas-microsoft-com:xml-analysis"> 
    <RequestType>DISCOVER_SESSIONS</RequestType> 
    <Restrictions>
        <RestrictionList>
        </RestrictionList>
    </Restrictions> 
    <Properties>
        <PropertyList>
           </PropertyList>
    </Properties> 
</Discover> 

  这一段脚本可以在服务器端直接执行

  那么这一段脚本怎么在客户程序中执行呢?

  【注意】ADOMD.NET是不可以直接执行DISCOVER命令的。我们一般通过下面这样的方式来做

  客户端需要封装一个SOAP Envelope(信封),在里面包含我们的脚本

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
  <Header>
    <XA:Session soap:mustUnderstand="1" SessionId="$sessionId$" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:XA="urn:schemas-microsoft-com:xml-analysis" />
  </Header>
  <Body>
<Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
    <RequestType>DISCOVER_SESSIONS</RequestType>
    <Restrictions>
        <RestrictionList>
        </RestrictionList>
    </Restrictions> 
    <Properties>
        <PropertyList>
           </PropertyList>
    </Properties>
</Discover>
  </Body>
</Envelope> 

  读取过来的信息是一片XML文档,大致如下


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3