CA NIM SM Configuration for ServiceNow Custom Endpoints

You can integrate CA NIM SM with ServiceNow for service management operations. ServiceNow is integrated by direct web services or custom web service endpoints. Custom web service endpoints can have good control of the tools that are being integrated with ServiceNow and the data that are being transferred. Also, you can impose specific access control and security checks before/after or during the operation.
nimsm31
You can integrate CA NIM SM with ServiceNow for service management operations. ServiceNow is integrated by or . Custom web service endpoints can have good control of the tools that are being integrated with ServiceNow and the data that are being transferred. Also, you can impose specific access control and security checks before/after or during the operation.
By default, CA NIM SM interacts with ServiceNow through direct web services. However when a flag is enabled in ServiceNow configuration within CA NIM SM (set
useCustomEndpoint
property to true), CA NIM SM starts to communicate with ServiceNow through defined custom web services.
Prerequisites
NIM has a capability to create and retrieve incidents so we need both
read
and
write
permissions for the required tables.
Note:
If we are not using
write
operations we need to provide the roles which are assigned for
read
operations on the required tables. There is no restriction to give the
write
permissions.
  • NIM uses SOAP calls to connect to ServiceNow so it requires following roles for a non-admin user for a plain servicenow instance (without any custom ACL rules or roles added to tables).
  • Overall we need the following roles for a servicenow user to use NIM:
    1. All the Soap related roles:
    soap
    ,
    soap_create
    ,
    soap_delete
    ,
    soap_ecc
    ,
    soap_query
    ,
    soap_query_update
    ,
    soap_script
    ,
    soap_update 
    2. Web service admin role:
    web_service_admin
    3. For Get Incident & Request & Change -
    odbc
    role
    4. For Create & Update Incident & Change-
    midserver
    role
    5. For Create & Update Request -
    catalog_admin
    role
    6. For Create a comment we need
    u_journal_entry_user
    role
  • Along with the above roles, we need provide the roles that are assigned in the ACLs of the tables
    incident
    ,
    sys_db_obj
    ,
    sys_user
    ,
    sys_dictionary
    ,
    sys_journal_field and task tables
    for
    read
    permissions. (Service now admin can help with the ACLs roles)
  • See the ServiceNow reference documentation for information about the non-admin roles required to interact with ServiceNow SOAP webservices.
Though CA NIM SM supports custom endpoints and custom functions, there are some prerequisites for such custom endpoints:
  • There is equivalent custom endpoints and functions for the following . The custom input and output parameters conform to the standard operations input and output.
    For example, getKeys function take sys_id and return the entire object. getRecords function filter based on __encoded_query.
      • insert
      • update
      • deleteRecord
      • deleteMultiple
      • get
      • getRecords
    For returning multiple rows using getRecords in a custom endpoint, of ServiceNow may be used.
  • The parameter names exactly match with the standard ServiceNow parameters. The WSDL structure of your custom web service match with the ServiceNow standard web service.
  • The custom endpoint name and the appropriate function name is noted for using them with the CA NIM SM configuration.
  • The following table lists the basic set of operations per Configuration Item (CI) that can be implemented in your custom or scripted web service:
YES - Indicates the specified operation on the specified CI is available as the custom endpoint.
NO - Indicates the specified operation on the specified CI need not be made available as the custom endpoint.
CITypes/Operation
insert
update
getRecords
getKeys
get
deleteRecord
deleteMultiple
ServiceNow tables
incident
YES
YES
YES
NO
YES
YES
NO
sys_journal_field
YES
NO
YES
NO
NO
NO
NO
task
NO
NO
YES
NO
NO
NO
NO
sys_dictionary
NO
NO
YES
NO
NO
NO
NO
sys_db_object
NO
NO
YES
NO
NO
NO
NO
task
NO
NO
NO
NO
NO
NO
NO
sys_attachment
NO
NO
YES
NO
NO
YES
NO
ecc_queue
YES
NO
NO
NO
NO
NO
NO
sys_attachment_doc
NO
NO
YES
NO
NO
NO
NO
sys_user
YES
YES
YES
NO
YES
YES
NO
sys_user_grmember
YES
NO
YES
NO
NO
NO
YES
sys_user_group
YES
YES
YES
NO
YES
YES
NO
cmdb_ci
NO
NO
YES
NO
YES
NO
NO
For example, incident insert is available as a custom endpoint and incident deleteMultiplemay not be implemented as a custom endpoint.
If you do not mention any of the operations for a table in the custom end point, the table name uses the default end point to perform the operation.
CA NIM SM Configuration to support ServiceNow Custom Endpoints
To make CA NIM SM work with Custom or scripted web service, the CA NIM SM configurations have to be modified for an appropriate custom endpoint and a custom function for every CI and custom operations. These are the steps that are followed on CA NIM SM for enabling ServiceNow Custom Web services:
  1. Configure the useCustomEndpoint  property
    1. Log in to CA NIM SM client UI and navigate to Configuration page of ServiceNow.
      The property
      useCustomEndpoint
      indicates whether CA NIM SM communicates with ServiceNow through custom endpoint (or scripted web services). By default the value is set to false, which implies that CA NIM SM is integrated to ServiceNow using direct web services.
    2. To integrate through custom endpoint, set the
      userCustomEndpoint
      parameter to true.
  2. Update the
    ServiceNowCustomEndpoint
    configuration file
Once you set the custom endpoint parameter in the configuration,
ServiceNowCustomEndpoint.xml
file is configured with custom endpoint and custom functions information. This custom endpoint which is mentioned in
ServiceNowCustomEndpoint.xml
fileis available in the configured Service Desk. This file resides in the CA NIM SM server in the WEB-INF\config\servicenow folder. The structure that is defined in the file is:
<CIType> <CI>CIName</CI> <Endpoint> <ServiceNowOperation>ServiceNowOperation1</ServiceNowOperation> <CustomEndpoint>CustomEndpoint</CustomEndpoint> <CustomFunction>CustomFunction1</CustomFunction> <!-- <CustomSOAPAction>customInsert</CustomSOAPAction> <CustomNamespace>http://www.service-now.com/customInsert</CustomNamespace> --> </Endpoint> <Endpoint> <ServiceNowOperation>ServiceNowOperation2</ServiceNowOperation> <CustomEndpoint>CustomEndpoint</CustomEndpoint> <CustomFunction>CustomFunction2</CustomFunction> </Endpoint> </CIType>
Here,
  • <CI> is the name of the Configuration Item whose custom endpoint and function are defined like incident, sys_journal_field, attachment, ticket.
  • <ServiceNowOperation> is one among the following standard set of ServiceNow operations - insert, update, deleteRecord, get, getRecords
  • <customEndpoint> is the actual custom endpoint being referred.
  • <customFunction> is the actual custom function within the custom endpoint being referred.
Apart from the properties mentioned, there are two other optional properties:
  • <CustomSOAPAction> If the exposed custom web service at ServiceNow expects SOAPAction header with every incoming request, then this parameter can hold the SOAPAction that CA NIM SM sends to ServiceNow.
  • <CustomNamespace> If the custom web service request is bound to a namespace and that namespace information can be provided through this parameter.
For example, Incident CI and comments CI operations are as follows:
<CITypes> <CIType> <CI>incident</CI> <Endpoint> <ServiceNowOperation>insert</ServiceNowOperation> <CustomEndpoint>sample_incident</CustomEndpoint> <CustomFunction>create</CustomFunction> </Endpoint> <Endpoint> <ServiceNowOperation>getRecords</ServiceNowOperation> <CustomEndpoint>sample_incident</CustomEndpoint> <CustomFunction>select</CustomFunction> </Endpoint> </CIType> <CIType> <CI>sys_journal_field</CI> <Endpoint> <ServiceNowOperation>insert</ServiceNowOperation> <CustomEndpoint>sample_comment</CustomEndpoint> <CustomFunction>create</CustomFunction> </Endpoint> <Endpoint> <ServiceNowOperation> getRecords</ServiceNowOperation> <CustomEndpoint>sample_comment</CustomEndpoint> <CustomFunction>select</CustomFunction> </Endpoint> </CIType> <CITypes>
Optionally, when CA NIM SM is expected to send the namespace and soap action, the same can be configured as a part of each endpoint configuration for example;
<Endpoint> <ServiceNowOperation>insert</ServiceNowOperation> <CustomEndpoint>sample_incident</CustomEndpoint> <CustomFunction>create</CustomFunction> <CustomSOAPAction>customInsert</CustomSOAPAction> <CustomNamespace>http://www.service-now.com/customInsert</CustomNamespace> </Endpoint>
All the operations that are indicated in the previously mentioned table are available as the custom endpoint and the same are configured in:
ServiceNowCustomEndpoint.xml