Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

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.

Web Service Authentication

The default Token-based API authentication is implemented for Web Service from the Sierra HF01 Release onwards. If you upgraded to the Sierra HF01 and want the User ID and Password-based authentication for Web Service, you can enable it. 

Configuration

You can enable the User id and Password-based authentication by adding the following key in the SummitAI web.config file:

<add key="IsAPIKeyDisabled" value="true" />

Note:

If the key is not added in the web.config file or if the value of this key is set as false, by default, the Token-based API based authentication is enabled to log into the SummitAI application.

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

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.

    Note:

    You can also create SQL Views, SQL Table, and SQL Procedure and modify the created fields.

     Create SQL View


    Figure: Create SQL View Page

     Create SQL Table


    Figure: Create SQL Table Page

    You can add indexes to improve the performance of the tables.

     Create SQL Procedure


    Figure: Create SQL Procedure Page

  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:

    Fields

    Description

    Module Name

    Select a Module for the Web Service.

    Active

    If selected, the Web Service configuration becomes active.

    User Access

    Type in the name of a user to whom you want to provide access to the Web Service.

    View Only

    If selected, the user will have read-only access to the Web Service and cannot do any modifications to it.

    Report Description

    Specify the description of the Web Service.

  4. Select the 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.

    Note:

    Create Relationship between the Data Sources if you want to use multiple Data Sources.

     Create Relationship

    To create relationship, select a Data Source. Fill in all the required details and click ADD RELATIONSHIP. A new Relationship is added.


    Figure: Relationship section

    Field Description

    The following table describes the fields under the RELATIONSHIP section:

    Fields

    Description

    Join Type

    Select a Join Type from the list.

    Data Source

    If multiple Data Sources are selected then select a Data Source from the list to create a relationship with it.

    Table Alias

    Select the alias name for the Data Source.

    Join Field

    Select a field from the drop-down list for selected Data Source.

    Foreign Data Source

    Select a Foreign Data Source from the drop-down list to create relationship with the selected Data Source.

    Join Field

    Select a field foreign Data Source from the drop-down list.

     Add Fields to the Web Service

    To add fields to Web Services:

    1. Drag and drop the attributes from the list to FIELDS and FILTERS section to define the mandatory fields and Filter attributes. You can configure the properties of the attributes in the FIELDS and FILTERS section.


      Figure: Fields Section

      Note:

      • Click  icon to copy all the fields.
      • Click  icon to remove all the copied fields.
    2. Upon selecting attributes, PROPERTIES section is displayed (if not displayed, click icon) and configure Properties. Select an attribute on FIELDS/FILTERS column, FIELD/FILTERS PROPERTIES is displayed. If not, click the PROPERTIES icon.


      Figure: Page Properties for Fields

    Field Description

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

    Fields

    Description

    Source Name

    Displays the Source Name of the attribute.

    Field Name

    Displays the Field Name.

    Field Alias

    If required, change the Field name.

    Sort

    Select the sort order from the drop-down list.

    Function

    Select the function of the attribute from the drop-down menu.

    Custom Expression

    Specify the custom expression, such as SQL calculations.

    Mandatory

    If selected, the corresponding field becomes mandatory.

  5. Click GENERATE SQL to generate SQL Query. 

     See Screen Shot


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


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

    Note:

    • The string values should be entered within double quotes. Example: ''Username''.
    • Data Manipulation Language (DML) is not allowed in the SQL query. Example: Delete, Truncate, Drop, Comment, Rename, Merge, Grant, Revoke, Commit, Savepoint, Rollback, Exec, and Execute.
    • If you want to pass any parameters, enter # before and after the respective Field name.
  6. Click PREVIEW to view the Output of the ongoing Web Service. 

     See Screen Shot


    Figure: Output Preview pop-up page

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

Creating Custom Tables in Web Services:

To Create a New Custom Table:

  1. Select Admin > Basic > Infrastructure > Web Services. The WEB SERVICE EXPLORER page is displayed.
  2. On the WEB SERVICE EXPLORER 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.


    Figure: WEB SERVICE DESIGNER page: Create SQL Table: SQL Table Name
  5. Click icon in FIELDS section to view FIELD PROPERTIES.


    Figure: WEB SERVICE DESIGNER page: FIELD PROPERTIES
  6. Type in Field Name (or Column Name) and select the Data Type value from drop-down list. 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).

    FieldDescription
    Field Name

    Specify the name for the field (or column).

    Data Type

    Select the required data type for the field (or column) from the drop-down list. Following are the available data types:

    • nvarchar: Select the data type as nvarchar to store variable characters (letters and numbers) in the field (or column).
      Note: In the size parameter, specify the maximum column length in characters.
    • int: Select the data type as int to store a whole number (not a fraction) in the field (or column).
    • numeric: Select the data type as numeric to store numbers that have fixed precision and scale.
    • decimal: Select the data type as decimal to store numbers that have fixed scale.  
    • bit: Select the data type as bit to store a single bit with a value of 0,1, or NULL
    • datetime: Select the data type as datatime to store date and time combination in the field (or column).
    • text: Select the data type as text to store text or combinations of text and numbers in the field (or column).
    Auto Identity

    Select this check box to define a field (or column) as auto increment field.

    Note:

    This field is displayed only for int, numeric, and decimal data types.

    Primary Key

    Select this check box to define a field (or column) as Primary Key.

    Note:

    Primary keys should contain unique values and cannot have NULL values.


  8. Click GENERATE SQL to generate the SQL Query.


    Figure: GENERATE SQL (sample screenshot)

  9. Click SAVE to successfully create the SQL Table. Click YES if you want to redirect to the Web Service Explorer page.



 Example 1: Create a Custom Table to Store Location-wise Approver Details.

Scenario: Consider that the user wants to create a Custom Table with the following fields to store Location-wise Approver details.

Column Name

Data Type

Country

varchar

State

varchar

City

varchar

EmailID

varchar

Approver

int

To Create a New Custom Table:

  1. Select Admin > Basic > Infrastructure > Web Services. The WEB SERVICE EXPLORER page is displayed.
  2. On the WEB SERVICE EXPLORER 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 the above table for column names and data types). 

  7. Click ADD NEW FIELD to add a new field (or Column). For more information about the fields on the FIELD PROPERTIES, see Field Description.


    Figure: WEB SERVICE DESIGNER: FIELD PROPERTIES

    Field Description

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

    FieldDescription
    Field Name

    Specify the name for the field (or column).

    Data Type

    Select the required data type for the field (or column) from the drop-down list. Following are the available data types:

    • nvarchar: Select the data type as nvarchar to store variable characters (letters and numbers) in the field (or column).
      Note: In the size parameter, specify the maximum column length in characters.
    • int: Select the data type as int to store a whole number (not a fraction) in the field (or column).
    • numeric: Select the data type as numeric to store numbers that have fixed precision and scale.
    • decimal: Select the data type as decimal to store numbers that have fixed scale.  
    • bit: Select the data type as bit to store a single bit with a value of 0,1, or NULL
    • datetime: Select the data type as datatime to store date and time combination in the field (or column).
    • text: Select the data type as text to store text or combinations of text and numbers in the field (or column).
    Auto IdentitySelect this check box to define a field (or column) as auto increment field.
    Primary Key

    Select this check box to define a field (or column) as Primary Key.

    Note:

    Primary keys should contain unique values and cannot have NULL values.

  8. Click GENERATE SQL to generate the SQL Query.


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

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

    Note:

    To view the Custom Table, type in  select * from Location_Table in the SQL Server Management Studio.

 Example 2: Create a Custom Table to Store Workgroup-wise Approver Details.

Scenario: Consider that the user wants to create a Custom Table with the following fields to store Workgroup-wise Approver details.

FieldsData Type
Workgroup

varchar

Workgroup Owner

int

Additional Owner

int

To Create a New Custom Table:

  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: Workgroup_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 the above table for column names and data types). 

  7. Click ADD NEW FIELD to add a new field (or Column). For more information about the fields on the FIELD PROPERTIES, see Field Description.


    Figure: WEB SERVICE DESIGNER: FIELD PROPERTIES

    Field Description

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

    FieldDescription
    Field Name

    Specify the name for the field (or column).

    Data Type

    Select the required data type for the field (or column) from the drop-down list. Following are the available data types:

    • nvarchar: Select the data type as nvarchar to store variable characters (letters and numbers) in the field (or column).
      Note: In the size parameter, specify the maximum column length in characters.
    • int: Select the data type as int to store a whole number (not a fraction) in the field (or column).
    • numeric: Select the data type as numeric to store numbers that have fixed precision and scale.
    • decimal: Select the data type as decimal to store numbers that have fixed scale.  
    • bit: Select the data type as bit to store a single bit with a value of 0,1, or NULL
    • datetime: Select the data type as datatime to store date and time combination in the field (or column).
    • text: Select the data type as text to store text or combinations of text and numbers in the field (or column).
    Auto IdentitySelect this check box to define a field (or column) as auto increment field.
    Primary Key

    Select this check box to define a field (or column) as Primary Key.

    Note:

    Primary keys should contain unique values and cannot have NULL values.

  8. Click GENERATE SQL to generate the SQL Query.


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

  9. Click SAVE to generate a new SQL Table successfully and the following pop-up page is displayed.

  10. Click YES. The WEB SERVICE EXPLORE page displayed.



    Note:

    To view the Custom Table, type in  select * from Workgroup_Table in the SQL Server Management Studio.

Various Methods to Import Data into Custom Table

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

Importing Custom Data into Custom Table Using Stored Procedure:

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.
  5. Type in the stored procedure to insert new records in a table.

  6. Click SAVE to insert values into table.

 Example 1: Import Custom Data into Custom Table (Location_Table)

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 (Ex: Location_table procedure).
  4. Select Edit Query check box.


    Figure: Edit SQL Query
  5. Type in the Stored Procedure to insert new records in the table.

     Sample Stored Procedure

    CREATE PROCEDURE [dbo].[Location_table procedure]

    AS

    BEGIN

    insert into Location_table(Country,State,City,EmailID,Approver)
    values(''USA'',''Alaska'',''Fairbanks '',''james@xyz.com'',''206'')

    insert into Location_table(Country,State,City, EmailID,Approver)
    values(''USA'',''California'',''Los Angeles'',''michael@xyz.com'',''207'')

    insert into Location_table(Country,State,City,EmailID,Approver) 

    values(''Canada'',''Ontario'',''Toronto'',''david@xyz.com'',''208'')


    END

  6. Click SAVE to insert values into the table.
 Example 2: Import Custom Data into Custom Table (Workgroup_Table)

Consider that you want to import data into Custom Table (Workgroup_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 (EX: Workgroup_Table).
  4. Select Edit Query check box.


    Figure: Edit SQL Query
  5. Type in the Stored Procedure to insert new records into the table.

     Sample Stored Procedure

    CREATE PROCEDURE [dbo].[Workgroup_Table]

    AS

    BEGIN

    insert into Workgroup_Table (Workgroup,[Workgroup Owner],[Additional Owner])
    values(''Server Team'',''4494'',''1'')
    insert into Workgroup_Table (Workgroup,[Workgroup Owner],[Additional Owner])
    values(''Wintel Team'',''4486'',''4488'')
    insert into Workgroup_Table (Workgroup,[Workgroup Owner],[Additional Owner])
    values(''Server Team'',''4494'',''2'')

    END

  6. Click SAVE to insert values into the table.




  • No labels