Kony Fabric console User Guide: Integration > Configure the Integration Service > MuleSoft Adapter

Mulesoft Adapter

MuleSoft (Anypoint Platform™) is a platform that helps app developers to design custom APIs and deploy to a Mule Enterprise Service Bus runtime (ESB). With MuleSoft integration service in Kony Fabric, developers can interact with more than 50 types of adapters.

To integrate a MuleSoft service in Kony Fabric, developers need to create a project in MuleSoft Studio, export the project to a local system, and then deploy it to Cloud Hub. On top of the project deployment, a RESTful API modeling language (RAML) file needs to be built, which defines all the API definitions in the project. A RAML file also contains the defined schemas with properties. When a user creates a project from AnyPoint API Studio with any adapter and builds a RAML file over the project, all the APIs can be used in Kony Fabric integration service. When a Kony Fabric user selects a MuleSoft adapter from Kony Fabric Console, based on the cloud hub portal credentials of the MuleSoft adapter, the system retrieves metadata from a RAML file and displays all APIs of a RAML file. Developers can add these APIs as operations in MuleSoft integration service in Kony Fabric Console.

Kony Fabric discovers the MuleSoft endpoints through a RAML file. Kony Fabric parses a RAML file and exposes all the MuleSoft endpoints through the integration service. Mobile app developers can use the configured MuleSoft integration service and access the backend systems supported by MuleSoft’s adapters.

Note: In Kony Fabric Console, you can provide login credentials of MuleSoft or upload a RAML file to configure an integration service.

Advantages

Limitations

Prerequisites

Adding a MuleSoft service involves the following steps:

Configure MuleSoft End-point Adapter

To configure a Mulesoft adapter in Integration Service Definition tab, follow these steps:

  1. In the Name field, provide a unique name for your service. When you enter the name, the name is updated for the active service under the Services section in the left pane.
  2. From the Service Type list, select Mulesoft.

    Note: XML is selected, by default.

  3. Provide the following details to create a SOAP service.
    FieldsDescription
    VersionSelect the version for the service.
    Choose API Discovery Type
  4. Note: All options in the Advanced section are optional.

  5. Enter the Description for the service.
  6. Click SAVE to save your service definition.

Create Operations for MuleSoft

The Operations List tab appears only after the service definition is saved.

Note: Click Operations List tab > Configure Operation. The Configured Operations list appears.

To create an operation, follow these steps:

  1. Click SAVE & ADD OPERATION in your service definition page to save your service definition and display the NewOperation tab for adding operations.
                        OR
    Click Add Operation to add a new operation or from the tree in the left pane, click Add > Add New Operation.
  1. In Operations List tab, click Operation Name list and select Operations.
  2. Click Add Operation. The Operation List tab appears.
  3. Provide the following details to configure operations.

    Field Description
    Groups

    Select the title of the RAML file that is uploaded at AnyPoint CloudHub.

    Based on the selected groups, the Versions drop-down list is loaded with the versions of the RAML file.

    Versions

    Select the required version. You can select only one version of the RAML file.

    Resources

    Select the required resource.

    Operation (HTTP Methods)

    Select the required check boxes for the defined methods in the RAML file.

    You can click Select all check box to select all the operations.

  4. Click Add Operation. The added operation appears under the Configured Operations section.

    The system creates a JSON service for the MuleSoft service. Operation names are auto-generated in the format. The default name format of a MuleSoft operation is <operation_name><resource_name>. You can change the operation name if required.
    For example, postfolder.

  5. Once you create operations for MuleSoft service, you can configure the operations such as adding parameters, adding test values, and fetching the response. Under Configured Operations, hover your cursor over the create operation, click the Settings>> Edit.

    Note: To edit an operation, you can also click the operation from the service tree pane.

    The system displays the selected operation in the edit mode. Provide the following details to configure the operation.

    FieldsDescription
    NameThe Name field is pre-populated with fields names of the selected database. You can edit this field.
    Operation Security Level

    It specifies how a client must authenticate to invoke this operation.

    Note: The field is set to Authenticated App User, by default.

    The Operation Path field is prepopulated with MuleSoft URL. You can edit this field if required.

  6. Note: All options in the Advanced section for operations are optional.

  7. Enter the Description for the operation.

Configure Request Operation for MuleSoft

Integration services accept only form-url-encoded inputs for all input parameters provided in service input parameters (request input).

You can perform the following actions in Request Input tab:

  1. Click Add Parameter  to add an entry (if the entries for input and the output tabs does not exist).
  2. To make duplicate entries, select the check box for the entry, click Copy and Paste.
  3. To delete an entry, select the check box for an entry and click Delete .
  4. Under the Body tab, perform the following actions:
    1. To forward the body of the client's request to backend as it is, select the Enable pass-through input body check box. For more details on API Proxy service, refer to How to Enable Pass-through Proxy for Operations.

    2. To configure parameters in the clients body, do the following:
      FieldDescription
      Name

      Enter the name for the request input parameter.

      Note:  In the Body tab > NAME field, the input parameters are prepopulated based on the properties of the input schema of a RAML file.

      Value

      Three different options are available in Kony Fabric under VALUE during configuration of any operation. When you start editing this field, dependent identity services are auto populated. These options primarily determine the source of the value of the header.

      Note: The field is set to Request, by default.

      TEST VALUEEnter a value. A test value is used for testing the service.
      DEFAULT VALUEEnter the value, if required. The default value will be used if the test value is empty.
      Scope

      Select request or session. This field is set to Request, by default.

      The default datatype for the selected column is loaded under DATATYPE field.

      EncodeSelect the checkbox to enable an input parameter to be encoded. For example, the name New York Times would be encoded as New%20York%20Times  when the encoding is set to True. The encoding must also adhere the HTML URL encoding standards.
  5. Click the Header tab to provide the following customer headers, perform the following actions:

    You must provide the custom HTTP headers based on the operation. For example, post or get.

    1. To configure parameters in the client's header, do the following:
      FieldDescription
      NameProvide custom HTTP headers required by the external source.
      Value

      Three different options are available in Kony Fabric under VALUE during configuration of any operation. When you start editing this field, dependent identity services are auto populated. These options primarily determine the source of the value of the header.

      Note: The field is set to Request, by default.

      Note: If the header value is scoped as a Request (or) Session and the same header is accessed under the Expression header value, then the expression must be represented as $request.header (or) $session.header.

      Example: If a header 1 value is a request and header 2 value is an expression, then the value of the expression must be $Request.header1.

      TEST VALUEEnter a value. A test value is used for testing the service.
      DEFAULT VALUEChange the syntax, if required. The default value will be used if the test value is empty.
      SCOPESelect request or session. The field is set to Request, by default.
      DescriptionEnter the Description for the request input.
  6. To validate the details, click Fetch Response. You can refer to Test a Service Operation for the steps to test a service.The result of the operation appears.

Configure Response Operation for MuleSoft

Click the Response Output tab to configure the fields of the table for displaying the data.

Note: If you define parameters inside a record as the session, the session scope will not get reflected for the parameters.

In the Response Output tab, configure the fields of the table for displaying the data:

  1. The Name field in the Response Output tab is prepopulated with the properties of output schema of a RAML file.

    Enter the values for required fields such as name, path, scope, data type, collection ID, record ID, format and format value

    Note: If you define parameters inside a record as the session, the session scope will not get reflected for the parameters.

  2. To validate the details, click Test. You can refer to Test a Service Operation for the steps to test a service. The result of the operation appears.
  3. Click SAVE OPERATION.

    Note: You can view the service in the Data Panel feature of Kony Visualizer. By using the Data Panel, you can link back-end data services to your application UI elements seamlessly with low-code to no code. For more information on Data Panel, click here.

 

Copyright © 2020 Kony, Inc. All rights reserved.