You want to fetch and process data from a WebService API.
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.
Choose Import > Import WebService API Configuration in the API Input operator. The page is shown in the following figure.
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.
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.
Settings items in API Configuration are shown in the following figure.
POST/GET
If an API supports both POST and GET methods, the POST request method is preferred.
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.
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.
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.
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.
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.
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.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy