It is no mystery that ServiceNow holds a number of powerful tools in its belt that facilitates the integration between an instance and a third party system. If an external program has any sort of API or hook to it, ServiceNow can invariably communicate with it.
One of the lesser known capabilities of ServiceNow is to leverage custom Java JAR files through a MID Server.
A MID Server is a small Java service that runs on a computer within your own network. Every few seconds it will make an outbound web service call to your ServiceNow instance to query for any work that we wish to have it perform. Once it finds a job assigned to it, it will execute the job and send another outbound message to ServiceNow to provide it with the result of the job.
A MID Server can do a number of out of the box jobs such as SOAP Requests, JDBC database calls, Shell Script execution, and Discovery.
One MID Server feature that stands out from the rest is its ability to consume and execute code from custom Java JAR files that are placed on the MID Server. This allows us the ability to integrate with older systems that may not have a web service or database API.
In the video tutorial below I will demonstrate the ability of the MID Server to consume any type of JAR file. We will leverage a customized Word Search Puzzle program that I wrote in Java to allow the ServiceNow instance to ask the MID Server to generate a Word Search Puzzle based on a specified string of comma separated words.
Check out this five minute video below:
Hello John,
I have a requirement to integrate a third party application with Service-now utilizing the api exposed by them. The jar is uploaded to the extlib folder using the JAR Files module. When I call the methods in the package using the Javascript Probe, I get the output in the ECC queue as :
TypeError: [JavaPackage org.demo.test] is not a function.
However, when I place the jar in the lib folder and invoke the package call using the Javascript Probe, I get the proper results in the ECC queue. I checked in the wrapper.conf file on the midserver that both the folders were present in the classpath as follows:
wrapper.java.classpath.1=lib/*.jar
wrapper.java.classpath.2=extlib/*.jar
Can you please help me what needs to be done to make the packages call work for the jar placed in extlib folder ?
John, Could you share something about how to prepare Eclipse/Netbeans environemnt for MID Server coding?
I cannot run my code as you did with information about ecc in console.