API Input - Webservice

  • Last update: January 20, 2025
  • Overview

    Application Scenario

    You want to fetch and process data from a WebService API.

    Function Description

    In the Data Transformation node of FineDataLink, you can fetch data from a WebService API using the API Input operator and process the fetched data.

    After you import the API configuration, the API Configuration value is generated automatically, and the request parameter and the request body are displayed on the Headers and Body tab pages, respectively. You only need to enter the parameter value or reference the parameter in the request body to complete the configuration of calling a WebService API.

    iconNote:
    Currently, WebService API calls support text, number, and date parameters only. (The parameter value is ultimately passed in as text.) Calls with other types of parameters are not supported.

    Function Description

    WebService API Configuration Import

    Choose Import > Import WebService API Configuration in the API Input operator. The page is shown in the following figure.

    iconNote:
    The OK button in the lower right corner is available only if the selected API exists.

    Setting ItemDescription
    WSDL Parsing Method

    1. File

    Upload the existing WSDL file, which will be parsed automatically.

    2. URL

    Fill in the URL of the WSDL file. The file will be downloaded from the URL and parsed automatically. Referencing the parameters is not allowed.

    API SelectionExpand the drop-down list, on which the callable APIs are displayed.

    When you re-open the task and enter this page:

    1. If WSDL Parsing Method was set to URL, all other settings will be cleared, and you need to fill in the URL again.

    1. If WSDL Parsing Method was set to File, all other settings will be cleared, and you need to upload the WSDL file again.

    API Configuration

    Settings items in API Configuration are shown in the following figure.

    Setting ItemDescription
    Request method

    POST/GET

    If an API supports both POST and GET methods, the POST request method is preferred.

    Request header
    iconNote:
    If a WebService API supports both SOAP 1.1 and SOAP 1.2, SOAP 1.1 will be used by default for parsing.

    For SOAP 1.1, the Content-Type value is text/xml; charset=Encoding of the parsed content.

    For SOAP 1.2, the Content-Type value is application/soap+xml; charset=Encoding of the parsed content.

    Request body

    It refers to the XML content in the request after parsing, where a question mark serves as the placeholder for the project to be filled in, as shown in the following figure.

    Replace the question mark in the XML content with the actual parameter value when calling an API that requires passing the parameter value. Reference the FineDataLink parameter in the ${Parameter name} format.

    Procedure

    Prerequisite

    For example, you want to extract weather conditions and basic information about different cities from an API, and parse and process the fetched data.

    The obtained request URL, headers, and the request parameter are shown in the following figure. 

       

    Test the API validity first, as shown in the following figure.

    API-Based Data Fetching 

    Create a new scheduled task, drag a Data Transformation node onto the canvas, and click the node to enter the editing page, as shown in the following figure.

    Drag the API Input operator onto the canvas, as shown in the following figure.

    Click the operator. Choose Import > Import WebService API Configuration. Set WSDL Parsing Method to URL (which can also be set to File) on the import configuration page, and enter the API URL suffixed with ?WSDL. (The URL is http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?WSDL in this example.) Select the required API. 

    Click OK. The API Configuration value is generated automatically, and the request parameter and the request body are displayed on the Headers and Body tab pages, respectively. You only need to enter the parameter value or reference the parameter in the request body to complete the configuration of calling a WebService API, as shown in the following figure.

    For SOAP 1.1, the Content-Type value is text/xml; charset=Encoding of the parsed content.

    For SOAP 1.2, the Content-Type value is application/soap+xml; charset=Encoding of the parsed content.

    You can modify the parameter value in the request body. For example, you can modify the parameter value to 3779 (the city code of London) to fetch the weather condition data of London, as shown in the following figure.

    Click Data Preview to view data fetched from the XML file, as shown in the following figure.

    Subsequent Operations

    You can use the XML Parsing operator to parse the XML data returned by the API into row-and-column format data for subsequent processing and storage.

    附件列表


    主题: Data Development - Scheduled Task
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy