ServiceNow与C#和dotnet核心应用程序集成

时间:2018-11-02 21:23:33

标签: docker servicenow servicenow-rest-api

受保护的无效Button1_Click(对象发送者,EventArgs e)       {

//Incident Service

        IncidentService.ServiceNowSoapClient soapClient = new IncidentService.ServiceNowSoapClient();
        soapClient.ClientCredentials.UserName.UserName = "username"; // username have SOAP role in SNow.
        soapClient.ClientCredentials.UserName.Password = "Password1";
        IncidentService.getRecords _getRecords = new IncidentService.getRecords();
        IncidentService.getRecordsResponseGetRecordsResult[] getRecordsResponses = soapClient.getRecords(_getRecords);
        _getRecords.active = true;

        // Note: Please enable SOAP/REST services in your SNow dev instance table(s), Also,
        // Go to system web services --> properties -> enable the 3rd option from the bottom.(This property sets the elementFormDefault attribute of the embedded XML schema to the value of unqualified)
        //ServiceNowSoapClient client = new ServiceNowSoapClient();
        //client.ClientCredentials.UserName.UserName = "username"; // username have SOAP role in SNow.
        //client.ClientCredentials.UserName.Password = "Password1";

        //insert newRecord = new insert();
        //insertResponse insertResponse = new insertResponse(); 
        //newRecord.first_name = "Jackson";
        //newRecord.last_name = "Chris";
        //newRecord.phone_number = "911-911-9999";
        //newRecord.number = "CUS3048232";
        try
        {
            //insertResponse = client.insert(newRecord);
            //TextBox1.Text = insertResponse.sys_id;

            getRecordsResponses = soapClient.getRecords(_getRecords);
            for (int i = 0; i < getRecordsResponses.Length; i++)
            {
                TextBox2.Text = getRecordsResponses[i].short_description;
                TextBox3.Text = getRecordsResponses[i].category;
            }
        }
        catch (Exception ex)
        {
            TextBox1.Text = ex.Message;
        }
        //finally { client.Close(); }

}

如何利用驻留在企业servicenow(CMDB,ITIL,各种企业数据库,新数据库)dev,prod实例中的ServiceNow数据 用C#dotnetcore创建端到端自动化应用程序。

我们的目标是使用ServiceNow,dotnetcore,C#,docker容器,Ansible,Automic端到端地自动化应用程序。

0 个答案:

没有答案