public string GetArticle(string id) { ServiceReference3.ServiceNowSoapClient soapClient = new ServiceReference3.ServiceNowSoapClient(); soapClient.ClientCredentials.UserName.UserName = "******"; soapClient.ClientCredentials.UserName.Password = "******"; ServiceReference3.getRecords getRecords = new ServiceReference3.getRecords(); ServiceReference3.getRecordsResponseGetRecordsResult[] response = { }; getRecords.number = id; try { response = soapClient.getRecords(getRecords); } catch (Exception ex) { } return(response[0].wiki); }
public async Task GetNews(IDialogContext context) { ServiceReference3.ServiceNowSoapClient soapClient = new ServiceReference3.ServiceNowSoapClient(); soapClient.ClientCredentials.UserName.UserName = "******"; soapClient.ClientCredentials.UserName.Password = "******"; ServiceReference3.getRecords getRecords = new ServiceReference3.getRecords(); ServiceReference3.getRecordsResponseGetRecordsResult[] response = { }; getRecords.topic = "News"; try { response = soapClient.getRecords(getRecords); } catch (Exception ex) { } foreach (var resp in response) { await context.PostAsync(resp.short_description); } }