Beispiel #1
0
        public object ExecQuery(ExecQueryOpSettings settings)
        {
            // OpenWbem doesn't support this call yet :(
            //throw new Exception("Not implemented yet");

            //I think this returns a list of ValueObjectWithPath objects
            ParseResponse pr = new ParseResponse();

            string opXml = Wbem.CimXml.CreateRequest.ToXml(settings, this.DefaultNamespace);
            string respXml = ExecuteRequest("ExecQuery", opXml);

            BatchResponse responses = pr.ParseXml(respXml);

            if (responses.Count != 1)
                throw (new Exception("Not a single response to a single request"));

            //CheckSingleResponse(responses[0], SingleResponse.ResponseType.CimValueObjectWithPathList);

            return responses[0].Value; //(CimValueObjectWithPathList)responses[0].Value;
        }
Beispiel #2
0
 public object ExecQuery(string queryLanguage, string query)
 {
     ExecQueryOpSettings settings = new ExecQueryOpSettings(queryLanguage, query);
     return ExecQuery(settings);
 }