Can MID server able to hit an URL exposed to internet

Prem Vikas K2
Tera Contributor

Can MID server able to hit an URL exposed to internet.

 

Example ServiceNow integration with another  ServiceNow instance via Mid Server

2 REPLIES 2

Mark Manders
Mega Patron

Yes, a MID Server can connect with internet-exposed sources.

 

The MID Server is designed to facilitate communication between ServiceNow instances and external systems or devices, including those that are internet-exposed. Here are some key points to ensure secure and effective connectivity:

 

Configuration Steps

1. **Network and Firewall Configuration:**
- Ensure that the MID Server's host machine can reach the internet-exposed sources by configuring the necessary firewall rules and network settings.
- Confirm that the MID Server can resolve the DNS names of the internet-exposed sources.

 

2. **MID Server Configuration:**
- Install and configure the MID Server according to ServiceNow's guidelines.
- Set up the appropriate capabilities and parameters for the MID Server to handle the required protocols and data formats.

 

3. **Authentication and Security:**
- Use secure communication protocols (e.g., HTTPS) to interact with internet-exposed sources.
- Implement proper authentication mechanisms, such as API keys, OAuth tokens, or basic authentication, depending on the external source's requirements.
- Ensure that any sensitive data exchanged is encrypted.

 

4. **ServiceNow Integration:**
- Use IntegrationHub, REST, or SOAP messages to define the integration logic within ServiceNow.
- Configure the MID Server as the execution target for the integration activities.

 

Example: REST Integration with an Internet-Exposed API

1. **Define the REST Message:**
- Navigate to `System Web Services > REST Message` in your ServiceNow instance.
- Create a new REST Message and configure the endpoint URL of the internet-exposed source.

2. **Add HTTP Methods:**
- Define the necessary HTTP methods (GET, POST, etc.) for your REST Message.
- Specify the request headers and parameters required by the external API.

3. **Set the MID Server:**
- In the REST Message's HTTP Method, specify the MID Server to be used for executing the request by selecting the `Use MID Server` checkbox and choosing the appropriate MID Server from the list.

4. **Test the Integration:**
- Test the REST Message to ensure it can successfully connect to the internet-exposed source via the MID Server.
- Verify the response and handle any errors or exceptions as needed.

 

Security Considerations

- **Whitelisting:** Ensure that the IP address of the MID Server is whitelisted on the external source's firewall.
- **SSL Certificates:** If using HTTPS, ensure the MID Server trusts the SSL certificates of the external sources.
- **Proxy Configuration:** If your network requires a proxy server for internet access, configure the MID Server to use the proxy settings.

 

Example Script for REST Integration

var restMessage = new sn_ws.RESTMessageV2('Your_REST_Message_Name', 'Your_HTTP_Method_Name');
restMessage.setMIDServer('Your_MID_Server_Name');

var response = restMessage.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();

gs.info('HTTP Status: ' + httpStatus);
gs.info('Response: ' + responseBody);

This script demonstrates how to execute a REST message via a specific MID Server and log the response.

By following these guidelines and configurations, a MID Server can securely and effectively connect with internet-exposed sources, enabling robust integrations with external systems and services.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Thanks Mark for the detailed explanation. The Mid Server needs a proxy server for internet access in our environment. Can you please provide the configuration steps for the same. The parameter addition in config.XML file helps only the MID server to connect to the source instance. Cannot able to connect the target instance