ServiceNow integration with C# and dotnet core application

protected void Button1_Click(object sender, 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(); }

}

How do you leverage ServiceNow data that reside in enterprise servicenow(CMDB,ITIL,various enterprise dbs, new dbs) dev,prod instances to create End to End automated applications with C#, dotnetcore.

our goal is to Automate applications end to end with ServiceNow, dotnetcore, C#, docker containers, Ansible, Automic.


Solution 1:

I know you probably don't need, maybe someone looking for the same finds this question.

I developed an library just for that.

https://emersonbottero.github.io/ServiceNow.Core/