Field descriptions
Following are elaborate descriptions of the fields available on the Create New Datasource screen:
- Communication App Id: Gateways act as the channel through which Canvas interacts with the external applications or servers using various protocols such as SMTP, HTTP, and so on.
The gateway types supported for REST web services by Canvas are:
- Rest GET JSON Gateway – This is the default option.
-Â Rest POST JSON Gateway
For your Web application to communicate with the targeted Web service, a Formatter and a Communicator Java class has been provided by Canvas. The Formatter class contains instructions on what needs to be sent to the Web service and the Communicator class contains instructions on how the information must be sent and to which Web service it must be sent. In the case of REST Web services, most of the formatting logic happens in the WebServiceExecutionController Java class which internally calls the DefaultRestServiceInstruction Java class provided by Canvas to use methods like getPathFilter, getStatus, and so on.
Canvas has the Formatter and the Communicator class in place for the supported Gateway types. The Formatter and Communicator classes for the respective gateways are listed in the MST_CIB_APPID_HANDLER_MAP table.
Depending on the requirement, you can write or extend the formatter or communicator class. If you write a new class, ensure that your formatter class implements the com.intellectdesign.canvas.hal.IFormatter interface and the communicator class implements the com.intellectdesign.canvas.hal.ICommunicator interface. - Service Type: Currently, Canvas supports the following HTTP methods of the REST service:
- GET – Select this option to fetch data. The operation must not change any state on the server. For GET, instead of a JSON payload request, path param and query param is sent to the Web service to fetch data.
- POST – Select this option to fetch or post information to the server. This method requires a payload request in JSON format to be sent to the Web service. We typically go with the body of the request when using the POST method. This method is secure compared to GET and is flexible as there is no limit to the data you want to pass to the Web service.
- Instruction Class: The DefaultRestServiceInstruction class contains the methods used in the Web service configuration. You can extend the DefaultRestServiceInstruction Java class and use your own methods or you can use the updateAndFilter() method provided in the Java class to modify the parsed path filter data. You can also override the DefaultRestServiceInstruction class.
For both GET and POST HTTP methods, the DefaultRestServiceInstruction class is used.
Copyright © Intellect Design Arena Limited.
All rights reserved. These materials are confidential and proprietary to Intellect Design Arena Limited and no part of these materials should be reproduced, published in any form by any means, electronic or mechanical including photocopy or any information storage or retrieval system nor should the materials be disclosed to third parties without the express written authorization of Intellect Design Arena Limited.