Contact Us 1-800-596-4880

Using Anypoint Studio to Configure ServiceNow Connector - Mule 4

Studio editors help you design and update your Mule applications, properties, and configuration files.

To configure a connector in Anypoint Studio:

  1. Create a Mule project.

  2. Supply your authentication credentials to Anypoint Platform.

  3. Add the connector to your Mule project.

  4. Configure an input source for the connector’s flow.

  5. Configure the connector.

Best Practices

Follow these best practices when you configure an input source and connector in Studio:

  • Configure an associated global element for the input source and connector.

  • Create a YAML or properties file to contain your properties, and then reference the file from the configuration.

  • Configure a reconnection strategy for the input source and target connector.

Add the Connector to Your Project

Add ServiceNow Connector to a Mule project both to automatically populate the XML code with the connector’s namespace and schema location and to add the required dependencies to the project’s pom.xml file.

  1. In Studio, create a Mule project.

  2. In the Mule Palette view, click (X) Search in Exchange.

  3. In Add Modules to Project, type "servicenow" in the search field.

  4. Click the ServiceNow Connector name in Available modules.

  5. Click Add.

  6. Click Finish.

Adding a connector to a Mule project in Studio does not make that connector available to other projects in your Studio workspace.

Configure the Connector

The ServiceNow Connector supports Basic and OAuth2 authentications. Select the authorization type to use from the Connection drop-down list.

The global element connection settings with basic authentication selected

Basic Authentication

  1. In the ServiceNow Config General tab, select Basic Authentication from the Connection drop-down list.

  2. Provide the following values for Basic authentication:

Field Description

Username

Name used to log in to ServiceNow

Password

Password that corresponds to the user name

Service Address

The WSDL endpoint

ServiceNow Version

The ServiceNow version to use

User table list

Custom tables for a user who is logged in

Basic Authentication HTTP Message Dispatcher Provider

  1. Click the Transport tab.

  2. From Transport Configuration, select Basic auth http message dispatcher provider.

  3. Enter the following required values:

Field Description

User Name

Name used to log in to ServiceNow

Password

Password that corresponds to the user name

Basic Authentication HTTP Requester Based Transport Provider

  1. Click the Transport tab.

  2. From Transport Configuration, select Http requester based transport provider.

  3. Select the Requester config or click the green plus sign to create a new one.

    The Transport configuration tab for basic authentication
  4. Specify the required values:

Field Description

Host

The WSDL endpoint

Username

User name for logging in to ServiceNow

Password

Password that corresponds to the user name

OAuth2.0 Authentication

  1. In the ServiceNow Config General tab, select OAuth 2.0 Authorization Code from the Connection drop-down list.

  2. Specify the values for the OAuth connection:

General tab for configuring OAuth 2.0 Authorization Code authentication
Field Description

Service Address

ServiceNow’s instance endpoint.

Consumer key

Client ID from the registered application.

Consumer secret

Client secret from the registered application.

Authorization url

Endpoint for initiating the OAuth dance.

Access token url

Endpoint for retrieving the access token.

Listener config

HTTP Listener configuration.

Callback path

The path of the access token callback endpoint.

Authorize path

The path of the local HTTP endpoint that triggers OAuth dance.

External callback url

If the callback endpoint is behind a proxy or should be accessed through a non-direct URL, use this parameter to specify the URL the OAuth provider should use to access the callback.

Configure an Input Source

Because ServiceNow operations can’t be used as input sources, you must configure the input source by using an HTTP Listener or Scheduler component:

  • HTTP Listener
    Start your app using a browser or a command such as curl.

  • Scheduler
    Start your app at timed intervals.

In Studio, drag the input operation you choose from the Mule Palette to the canvas.

Next Step

After configuring ServiceNow Connector in Studio, see the Examples to experiment with the connector.

View on GitHub