public static void InvokeMethodASync(CimSession cimSession, string cimNamespace, string cimClassName) { try { string methodName; CimInstance inputInstance; CimMethodParametersCollection methodParameters = InvokeMethodCore(cimSession, cimNamespace, cimClassName, out methodName, out inputInstance); if (methodParameters == null) { Console.WriteLine("Operation InvokeMethod not performed"); return; } CimAsyncMultipleResults<CimMethodResultBase> invokeParams; CimOperationOptions options = GetOperationOptions(); options.EnableMethodResultStreaming = true; if (inputInstance == null) { invokeParams = cimSession.InvokeMethodAsync(cimNamespace, cimClassName, methodName, methodParameters, options); } else { invokeParams = cimSession.InvokeMethodAsync(cimNamespace, inputInstance, methodName, methodParameters, options); } TestObserver<CimMethodResultBase> observer = new TestObserver<CimMethodResultBase>(); IDisposable disposeable = invokeParams.Subscribe(observer); observer.WaitForCompletion(); } catch (CimException ex) { PrintCimException(ex); } catch( Exception ex) { Console.WriteLine(ex.Message); } }