You are here: Creating an Integration Service

Creating an Integration Service

Now that we can authenticate our users, we need an easy way to retrieve data from an existing back-end system. In many cases, the back-end system does not return the data in the exact format we want, and/or it returns more data than our app needs.

The Kony Fabric Integration Services can consume data from any back- end system. You can use our standard technology connectors for REST, JSON, or SOAP web services. You can also use our enterprise business connectors that make it easy to connect to enterprise back-end systems like Salesforce or SAP, and browse for the data objects and services you want to expose to your app.

For this example, we will use a publicly available SOAP web service for getting weather information. To get the current weather and the weather forecast for a ZIP code, we will have to call two separate services.

To call the weather services, follow these steps:

  1. Under the Configure Services tab, Click the Integration tab.
  2. Click CONFIGURE NEW.

  3. Name your new service Weather and choose SOAP as the Endpoint Type.
  4. Then enter the following URLs to complete the service definition:
    • In the Base URL box, type: http://wsf.cdyne.com/WeatherWS/Weather.asmx
    • In the WSDL URL box, type: http://wsf.cdyne.com/WeatherWS/Weather.asmx?wsdl
  5. In the Choose WSDL URL, select the option to specify the WSDL URL or upload the WSDL file.

    • If you click Specify WSDL URL, the system displays URL text box. Enter the WSDL URL.
    • If you click Upload WSDL File, the system allows you to upload the WSDL file. Click the Upload WSDL File button to navigate to the WSDL file from your local system, and then click Open. The system uploads your WSDL file.
  6. In the Client Authentication field, select an identity provider from the drop-down list. This drop-down list shows identity providers only if you have created identity providers for OAuth 2.0 in the Identity page.

  7. Under the Web Service Authentication, select one of the following modes:

    1. None: Select this option if you do not want to provide any authentication for the service.

    2. Basic: Provide User ID and Password if the external Web service requires form or basic authentication.

    3. NTLM: Your service follows the NT LAN Manager authentication process. You are required to provide the User ID, Password, NTLM Host, and NTLM Domain.

    4. To enable the proxy, select the Use proxy from settings check box. By default, the check box is cleared.

  8. Click SAVE to retrieve the WSDL. Each of the available operations are listed in a drop-down box. Select the GetCityForecastByZip and GetCityWeatherByZip. Click Add Operation. This will create two operations under your Weather service that maps to the SOAP web service methods.
  9. To test and edit the GetCityWeatherByZip, click the settings icon and choose Edit.

  10. The operation details window opens. A sample web service request is provided showing a placeholder for any input parameters. For the GetCityWeatherByZip, the ZIP is the only input parameter displayed as <ns1:ZIP>?XXX?</ns1:ZIP> in the sample request. At this point, we could hard code a value, but since we want our app to provide the zip code, we need to provide an input variable name: <ns1:ZIP>$zip</ns1:ZIP>. We then need to define that variable under the input tab including a test value of 10036.

  11. You can then test the service and see the SOAP web service response.

  12. On the Output tab, enter the following parameters and path.

    city //City

    state //State

    temp //Temperature

  13. Click the Test button again and the result will be displayed as XML.

    The result will be converted to a JSON before being sent to the device.

    Note: This is a simple example, but it shows the power and flexibility the Kony Fabric Integration Service provides to retrieve data and process it before returning an optimized JSON string to the device. You can also configure additional processing under the advanced tab including deploying custom code that executes before and after the service invocation.

  14. Edit the GetCityForecastByZip in the same way. This service returns a repeating data structure for each day providing that day’s weather forecast. This requires the use of the collection ID under the output tab to create a repeating set of JSON objects. After creating the ZIP input parameter the same way as the previous service, enter the following output parameters:
    IDxPathCollectionID
    ForecastList//ForecastResult/Forecast 
    dateForecast/DateForecastList
    descForecast/DescriptionForecastList
    lowForecast/Temperatures/MorningLowForecastList
    highForecast/Temperatures/DaytimeHighForecastList
    daypctForecast/ProbabilityOfPrecipiation/DaytimeForecastList
    nightpctForecast/ProbabilityOfPrecipiation/NighttimeForecastList

    Test your service and you will see the resulting XML showing the repeating collections of forecasts.

Last updated on : 04 March, 2021 Copyright © 2014 Kony, Inc. All rights reserved.