Posting Array of Objects to Web Service
Canvas now enables you to post array of objects to a web service in a feasible and viable manner. By means of simple and efficient configurations, you can post the array of objects to a web service, thereby facilitating the means of posting the data to a web service in an effective way.
To post the array of objects to a web service, perform the following steps in Canvas Studio:
Let's assume that a webs service connection has already been created in Canvas Studio. For detailed information on creating a web service connection, refer Creating a Web Service Connection.
- In the Connections list, right-click the existing web service connection and select the Create Data Source option.
The Create New Data Source screen appears.
- Enter an appropriate name in the Web Service Name field, e.g. POST WEB SERVICE DS.
- Enter the relative part of the web service URL in the Relative part of the URL field, e.g. publisher/AutoFunding.
- Click the Communication App ID and select the REST POST JSON Gateway option.
- Click the Upload JSON option to upload the appropriate JSON file, e.g. Details.json.
- Specify the appropriate column root in the Column Root field, e.g. $.Response.
- In the JSON Configuration, categorized under Request JSON Configuration, click the icon, on the extreme right side of the Object tab to create a new object.
- Type the appropriate array name in the Name field, e.g. record.
Note: For an array, the suffix $form should be added to the array Name, e.g. record$form.
- Click the Text drop-down list and select the Array option.
- Proceed to click Add.
- Hover the mouse on the extreme right side of the newly created array and click icon to add a new object.
- Click the Text drop-down list and select the Object option.
- To add the object, click Add.
- Hover the mouse on the extreme right side of the newly created object and click icon to add a new object.
- Provide the appropriate key in the Name field, e.g. accountNumber.
- Enter an appropriate value in the Value field, e.g. $form.accountNumber.
Note: The value should be mandatorily provided as $form.<Value> in the Value field, e.g. $form.accountNumber.
- To add the object, click Add.
- To save the web service data source, click Save.
A confirmation message, indicating the successful creation of web service data source, appears.
- Click Ok.