private PivotalCommand CreatePivotalCommand(string serverTaskName, string serverTaskMethodName, object[] parameters) { PivotalCommand command = PivotalCommand.CreateExecuteServerTaskCommand( pivotalSystemName, serverTaskName, serverTaskMethodName); command.Parameters = parameters; return(command); }
public static PivotalCommand CreateExecuteServerTaskCommand( string pivotalSystemName, string serverTaskName, string serverTaskMethodName) { PivotalCommand cmd = new PivotalCommand(); cmd.PivotalSystemName = pivotalSystemName; cmd.ServerTaskName = serverTaskName; cmd.ServerTaskMethodName = serverTaskMethodName; cmd.Parameters = new object[0]; return(cmd); }
public async Task <object[]> Execute(PivotalCommand command) { HttpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml")); if (timeoutms > 0) { HttpClient.Timeout = TimeSpan.FromMilliseconds(timeoutms); } var response = await HttpClient.PostAsync(pivotalXmlServicesUri, new StreamContent(new MemoryStream(Encoding.UTF8.GetBytes(command.ToString())))); response.EnsureSuccessStatusCode(); return(ParseResponse(await response.Content.ReadAsStringAsync())); }
public virtual Task <object[]> Execute(string serverTaskName, string serverTaskMethodName, params object[] parameters) { PivotalCommand command = CreatePivotalCommand(serverTaskName, serverTaskMethodName, parameters); return(Execute(command)); }