Specifying the host name and port of the integration service

If you are writing a JavaScript application for a Node.js client, then you must specify the host name and port that are used to call the integration service.

You must add the following lines of code to your JavaScript application, before the code that calls the integration service, so that your application can locate the integration service:
IBMIntegration.service_name.IBMContext.hostname = "host_name";
IBMIntegration.service_name.IBMContext.port = port;
where:
service_name
Specifies the name of the integration service.
host_name
Specifies the host name or IP address of the integration node where the integration service is deployed.
port
Specifies the port number of the listener that is used by the integration server where the integration service is deployed. For information about determining the listener that is used by an integration server, see HTTP listeners.

The lines of code are required only when the JavaScript application is run in a Node.js client. If the lines of code are included in an application that is run in a web browser, the code is ignored.

The following example shows a JavaScript application where the host name and port for an integration service named OperationsService are specified before the integration service is called:

IBMIntegration.OperationsService.IBMContext.hostname = "myhost.company.com";
IBMIntegration.OperationsService.IBMContext.port = 7800;

var multiInputVar = 
{
    "input1" : "input1Value" , 
    "input2" : "input2Value"
};

IBMIntegration.OperationsService.multiInput( multiInputVar, function(errorObj, responseObj))
{
  console.log("IBMIntegration.OperationsService.multiInput()");
  console.log("Response "+JSON.stringify(responseObj));
  console.log("Response="+responseObj.output1);
});