Пример #1
0
        public BatchResponse ExecuteBatchRequest(BatchRequest request)
        {
            ParseResponse pr = new ParseResponse();

            string opXml = Wbem.CimXml.CreateRequest.ToXml(request);
            string respXml = ExecuteRequest("BatchRequest", opXml);

            return pr.ParseXml(respXml);
        }
Пример #2
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;
        }
Пример #3
0
        public void EnumerateInstances(EnumerateInstancesOpSettings settings, CimDataTypeHandler callBack)
        {
            string reqXml = Wbem.CimXml.CreateRequest.ToXml(settings, this.DefaultNamespace);
            string respXml = ExecuteRequest("EnumerateInstances", reqXml);

            ParseResponse pr = new ParseResponse();

            pr.ParseXml(respXml, callBack);
        }
Пример #4
0
        public void Associators(AssociatorsWithInstanceNameOpSettings settings, CimDataTypeHandler callBack)
        {
            ParseResponse pr = new ParseResponse();

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

            pr.ParseXml(respXml, callBack);
        }
Пример #5
0
        private SingleResponse MakeSingleRequest(string cimOperation, SingleRequest operation)
        {
            ParseResponse pr = new ParseResponse();

            string reqXml = Wbem.CimXml.CreateRequest.ToXml(operation, this.DefaultNamespace);
            string respXml = ExecuteRequest(cimOperation, reqXml);

            BatchResponse responses = pr.ParseXml(respXml);

            if (responses == null)
            {
                return new SingleResponse();
            }

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

            return responses[0];
        }
Пример #6
0
        public void References(ReferencesWithClassNameOpSettings settings, CimDataTypeHandler callBack)
        {
            ParseResponse pr = new ParseResponse();

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

            pr.ParseXml(respXml, callBack);
        }