public async Task <object> Subscribe(string service, double accountId) { TypedObject body = WrapBody(new TypedObject(), "messagingDestination", 0); body.type = "flex.messaging.messages.CommandMessage"; TypedObject headers = body.GetTO("headers"); if (service == "bc") { headers.Add("DSSubtopic", "bc"); } else { headers.Add("DSSubtopic", service + "-" + accountID); } headers.Remove("DSRequestTimeout"); body["clientId"] = service + "-" + accountID; int Id = Invoke(body); while (!results.ContainsKey(Id)) { await Task.Delay(10); } TypedObject result = GetResult(Id); // Read result and discard return(null); }