Configuring Web Services

Configuring Web Services

What is a Web Service?

A Web Service is a method of communication between two applications or electronic devices over web. You can either use pre-defined web services that come along with the SummitAI application or build Custom Services based on your organization's requirement.

Web Services are of two types:

  1. Simple Object Access Protocol (SOAP)

  2. Representational State Transfer (REST)

SOAP defines a standard communication protocol (set of rules) specification for XML-based message exchange. SOAP uses different transport protocols, such as HTTP and SMTP.

The standard protocol HTTP makes it easier for SOAP model to tunnel across firewalls and proxies without any modifications to the SOAP protocol. SOAP can sometimes be slower than middleware technologies like CORBA or ICE due to its verbose XML format.

REST describes a set of architectural principles by which data can be transmitted over a standardized interface (such as HTTP). REST does not contain an additional messaging layer and focuses on design rules for creating stateless services. A client can access the resource using the unique URL and a representation of the resource is returned. With each new resource representation, the client is said to transfer state.

While accessing RESTful resources with HTTP protocol, the URL of the resource serves as the resource identifier and GET, PUT, DELETE, POST and HEAD are the standard HTTP operations to be performed on that resource.

Provide the Service URL to create a Web Service.


Figure: Edit Service URL

 

Service URL example: http://<webserviceurl>/REST/Summit_RESTWCF.svc

Replace <webserviceurl> with base URL.

To preview a Web Service:

  1. Select Admin > Basic > Infrastructure > Web Services.

  2. Select a URL from the drop-down list.

  3. Select a service from the Custom Services list.

  4. Fill in all the mandatory fields and then click SUBMIT. The Output Data is displayed.


    Figure: Web Services Preview page

Field Description

The following table describes the fields on the WEB SERVICES EXPLORER page:

Fields

Description

Fields

Description

Custom Services/Predefined

Services

Displays the list of services available. Select a service from the list to extract data from the application through the Web services. Type in the name of the services to search from the list. Click Filters icon to filter the services according to modules.


Figure: Web Services Filter

View Custom Services

Click View Custom Services (highlighted in red color in the above image) to display the list of Custom Services created by the users.

View Predefined Services

Click View Predefined Services (highlighted in green color in the above image) to display list of services already defined in the SUMMIT application.

Refresh

Click to Refresh the list.

URL

Select Input URL format from the drop-down list, either JSON Object or JSON String or XML.
Click EDIT to edit the existing URL. See Screen Shot.


Figure: Edit Service URL

Service URL example: http://<webserviceurl>/REST/Summit_RESTWCF.svc

Replace <webserviceurl> with base URL.

Mandatory Fields

Displays Mandatory Fields for the selected service.

Input Data

Displays Input parameter for the selected URL Type.

Output Data

Displays Output for the selected URL Type.

Search Bar

You can search for the web services, based on their properties. For example, if you specify table in the search bar, all the existing tables will be displayed.

To create Custom Services:

  1. Click CREATE NEW. The WEB SERVICE DESIGNER page is displayed.


    Figure: Web Service Designer page

  2. Type in the Web Service Name and specify the number of records to be displayed.

  3. Click

     icon to view, hide or customize the web service properties. 


    Figure: Web Service Properties

    Field Description

    The following table describes the fields on the PAGE PROPERTIES section:

  4. Select check box to select DATA SOURCE from the list. You can scroll down to see all the available Data Sources or type in the Data Source name in the search box to search a particular Data Source.

  5. Click GENERATE SQL to Generate SQL Query. 

  6. Click PREVIEW to view the Output of the ongoing Web Service. 

  7. Click SAVE. The Web Service is added to the WEB SERVICE PREVIEW list.

Creating Custom Tables in Web Services:

Consider the following sample Custom Table and Custom Data as an example.


Figure: Custom Table( Location_table)

Note: The Approver ids are taken from the UserID column of summit user master table based on e-mail id or NTID.

Figure: Summit User Master Table

To create a new Custom Table, perform the following steps:

  1. Select Admin > Basic > Infrastructure > Web Services. The WEB SERVICE EXPLORE page is displayed.

  2. On the WEB SERVICE EXPLORE page, click CREATE NEW. The WEB SERVICE DESIGNER page is displayed.

  3. On the WEB SERVICE DESIGNER page, select Create SQL Table from drop-down list.

  4. Specify the SQL Table Name (Ex: Location_table).


    Figure: WEB SERVICE DESIGNER page: Create SQL Table: SQL Table Name

  5. Click

    icon in FIELDS section to view FIELD PROPERTIES

  6. Type in Field Name (or Column Name) and select the Data Type value from drop-down list (Refer below table for column names and data types). For more information about the fields on the FIELD PROPERTIES, see Field Description.

  7. Click ADD NEW FIELD to add a new field (or Column).


    Figure: WEB SERVICE DESIGNER: FIELD PROPERTIES

    Field Description

    The following table describes the fields on the FIELD PROPERTIES section:

  8. Click GENERATE SQL to generate SQL Query.


    Figure: GENERATE SQL (when Edit Query check box is not selected)

  9. Click SAVE to generate a new SQL /Custom Table successfully.

Importing Custom Data into Custom Tables:

The administrators can use the following methods to import data into the Custom Table:

  • Import the data form source systems (such as: AD, SAP or HR) via API

  • Backend Import -you can import a file (.csv,.txt, etc.) into your database using SQL Server Management Studio.

  • SQL Query or Stored Procedure

Consider that you want to import data into Custom Table (Location_table)

To import data into custom table using stored procedure:

  1. On the WEB SERVICE EXPLORE page, click CREATE NEW. The WEB SERVICE DESIGNER page is displayed.

  2. On the WEB SERVICE DESIGNER page, select Create SQL Procedure from drop-down list.

  3. Specify the SQL Stored Procedure Name.

  4. Select Edit Query check box.


    Figure: Edit SQL Query

  5. Type in the stored procedure to insert new records in a table.

  6. Click SAVE to insert values into table.