IBM Integration Bus, Version 9.0.0.8 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

Calling an integration service by using a JavaScript client API

When a JavaScript client API is generated from an integration service, a JavaScript developer can use the JavaScript client API to call the integration service from an application that is running in a JavaScript environment.

Complete the following steps to call an integration service from a JavaScript application:

  1. Understand the conventions that you must use, and the limitations that you must be aware of, when you write an application that uses the JavaScript client API to call an integration service; see JSON conventions for calling an integration service by using a JavaScript client API.
  2. Obtain the integration service URL from the IBM Integration Bus integration service developer or administrator, or complete the following steps:
    1. In the IBM Integration Toolkit, click the deployed integration service in the Integration Nodes view.
    2. Click the Properties tab.
    The integration service URL is listed in the Info section.
    Note: The integration service URL is available only when the integration service has a SOAP/HTTP binding.
  3. Access the integration service URL by using a web browser, and click the JavaScript Client API link. A web page is displayed. The web page contains the following items:
    • A link to the JavaScript client API file, which you can download (if you are developing a Node.js application) or reference (if you are developing a web browser-based JavaScript application). You can then use the JavaScript client API file to access the integration service.
    • Details of the JavaScript client API methods of the integration service operations, which include the input and output objects.
    • Details of the errors that might be returned from the integration service.
    • Sample code that you can add to your JavaScript application to call the JavaScript client API methods of the integration service operations, and to process any errors that are returned from the integration service.

    For more information about the contents of the web page, see Integration service web page.

  4. Optional: If you are developing a Node.js application, then complete the following steps:
    1. Use the Node.js package manager (npm) to install the Dojo package by changing to the Node.js installation directory and typing the following command on the command line:

      npm install dojo

    2. Download the service_name.js JavaScript client API file from the web page, where service_name is the name of the integration service.
    3. Create a Node.js application that imports the downloaded JavaScript client API file.
    4. Specify the host name and port of the integration service; see Specifying the host name and port of the integration service.
  5. Optional: If you are developing a web browser-based JavaScript application, then complete the following steps:
    1. Create a web browser-based JavaScript application.
    2. Reference the dojo.js module and the JavaScript client API file for the integration service; see Referencing the dojo.js module and the JavaScript client API file.
  6. Use the information on the integration service web page to help you complete the following tasks:
    • Create the input objects for the JavaScript client API methods of the integration service operations.
    • Use the sample code in your JavaScript application to access the JavaScript client API methods of the integration service operations.
    • Add code to your JavaScript application that handles the errors that might be returned from the integration service, and interrogates the errors for the information you require.

You can write a JavaScript application to call an existing integration service.


ss26020_.htm | Last updated Friday, 21 July 2017