CTC Web Services Generator - Features
RESTful Web Services Easy to Invoke Top of page

The Web Services are based on the REST architecture. This makes it easy for the calling client applications to send and receive data to and from your AB Suite application. The calling client can perform predefined operations using the Restful services.

To make an inquiry using the web services interface to the AB Suite application is as simple as sending a URL with the inquiry.

As an example, the following URL will inquire on customer C01 though the CUST ispec:

Web services are invoked from external applications. However, as an example, when an inquiry as the above is submitted from a browser, the response will look as follows:

Default response in JSON format to an inquiry

Data Format is Determined by Client Application Top of page

The format of the data being exchanged with the web services can be determined by the client application. By default, the data format of request and response is JSON. However, the web services also supports XML as the data format.

The data format to be used is determined by the client application at runtime. Depending on the environment and programming language chosen, the client application can deside to use whichever format, JSON or XML, is convenient for the application when processing the request and response.

Request data format is specified by setting the ContenType property of the Http Header to either 'application/json' or 'application/xml'.

Response data format is specified by setting the Accept property of the Http Header to either 'application/json' or 'application/xml'.

Below is shown a json and xml sample data format:

CTC Web Service Controller Top of page

The CTC Web Service Controller is specifically designed to encapsulate everything related to the runtime management of the generated ispec Service Models, including all communication with the back-end AB Suite host system and the processing of request/response messages to/from the client applications.

The Service Controller is very flexible and customizable. It is utilized from the customizable HostInterface module. Through the programmatic interface provided by the Service Controller, the HostInterface module can get control at key events during the processing of the service request and the communication with the AB Suite host system.

Major features of the CTC Web Service Controller include:
  • Complete host system session management
  • Processing of service request/response messages
  • Error handling
  • Customization through flexible API and event handling

See also the Runtime Architecture.

Configurable Data Type Controls Top of page

The CTC Web Services Generator includes a number of standard Data Type controls that determine how the data items on an ispec are generated. Standard Data Type controls included are:

Alpha Type Control    Controls the generation of data items defined as alpha-numeric.
This includes Alpha and String types.
Boolean Type Control    Controls the generation of data items painted as a single Push Button or a single CheckBox that contain true/false values specified at design time.
CopyFrom Type Control    Controls the generation of a CopyFrom area.
A CopyFrom area is generated as a .NET class with a property for each data item in a copyfrom row.
Date Type Control    Controls the generation of data items defined as date.
A date is generated as a .NET DateTime type. At runtime, dates in ispec date format are converted to universal date format when sent to the client application and converted back to the ispec date format when received from the client application.
Enum Type Control    Controls the generation of data items painted as controls such as Push Button, Radio Button, List Box and Combo Box that contain a list of values specified at design time.
This creates a .NET Enum type containing a list of valid values for a data item. This is then included in the Service Contract, making it easy for the client application to know the possible values for a property.
List Type Control    Controls the generation of data items painted as a List Box or Combo Box that at runtime creates a dynamic list.
A .NET class is created for the list with a property for each column in the list.
Maint Type Control    Controls the generation of the Maint field on standard component ispecs.

Using the CTC Configurator, the properties of a data type control can be customized by modifying the default template of a data type control to suit specific requirements.

The CTC Configurator provides a Properties Editor, which allows the user to edit the complete set of properties for a control. As an example, shown below is the default template for the CopyFrom Type Control. For a CopyFrom Type, you can specify the comparison to be performed at runtime to eliminate empty rows of a CopyFrom area being sent to the client application.

CopyFrom Type Control Properties Editor
See also the Custom Controls.

Web Services Testing Tool Top of page

Proviced with the generator is a Test Client, which is a tool for testing the generated web services without having to create and develop a Client Application. A short cut for starting the Test Client with either IE or Chrome is added to the generated solution. To run the Test Client, double click on the short cut for your preferred browser.

Web Services Test Client
As shown in the above example, the Test Client provides a list of operations available on the generated Web Services. Selecting an operation, input fields required for the operation are created for each field on the ispec model. When entering data in the fields and submitting the request by clicking the Invoke button, the response from the web services is shown. Clicking the Request button shows the URI, HTTP Request method, Content-Type and Data format of the request for the web service operation. This provides an example of how to invoke the selected web services operation.

Custom Code Module Top of page

The generator can optionally add a custom code module to the generated Service Model for selected ispecs.

A custom code module allows users to add code specific to a Service Model to handle specific requirements during the processing of the service request. In the code module, users can add additional properties to be part of the service message interface, or add code for validating input from the external client application before the data is sent to the host system.

Once a code module is created, it is not overwritten or in any way affected by the generator.

Column Formatted Lists Top of page

Data items painted as a List Box or Combo Box can be sent to the client application as a column formatted list.

Using the CTC Configurator, a List that on the host AB Suite System is created as a single column for each row can be broken up into individual columns and returned to the client application as a column formatted list.

The example below shows how a list typically is created on the AB Suite System and returned to the Client Application with a key column and the data in a single column:

List - Single Column
Configuring the List Type control using the CTC Configurator, a list can be broken up into individual columns. Each column can be given a name, columns containing numeric data can be identified and columns containing dates can be identified. Numeric data containing characters such as currency symbols and trailing signs will be converted into 'proper' numeric values. Dates will be converted to universal date format.

The example below shows the configuration of a List Type control:

List Control - Column Formatting
The examle below shows how a list configured with with multi columns is returned to the Client Application:

List - Multi Column

Alternate Services Top of page

The Alternate Services feature is intended for those who have very specific requirements and want to design custom services.

Alternate Service can be created for selected ispecs and when specified, the generator creates a copy of the current generated version of the Service Model. This copy then provides the starting point for designing and developing the custom service while taking advantage of the infrastructure provided by the generated Adapter solution.

Once an alternate service is created, it is not overwritten or in any way affected by the generator.

External Data Files Top of page

The List Type Control can be configured to include data from XML formatted files external to the AB Suite systems.

The List Type Control includes properties that allow specification of the file path, an expression for extracting nodes, and columns to display in the list. When specified, the data elements of the file matching the expression will automatically be included in the response message sent to the client application. If necessary, rows and columns from the Xml file can be manipulated in a custom code module added to the Service Model.

Below is an example of the specifications of a List Type Control including data from an XML file located in ExternalLists/Countries.xml. The columns code, name and population of each country element will be included in the client response message.

<ListItem Order="[ORDER]" PropertyName="[PROPERTYNAME]" ListType="[LISTTYPE]"
  XmlFilePath="ExternalLists/Countries.xml" XmlElementPath="//country">
  <Key PropertyName="CountryCode" DataType="" Column="code" />
  <Column PropertyName="Name" DataType="" Column="name" />
  <Column PropertyName="Population" DataType="ClientDataTypes.IntType" Column="population" />

Automatic Setup of Application Infrastructure Files Top of page

The generator automatically installs all required infrastructure files into the bundle views directory. No manual steps are required for this. When running the generator for the first time on a new bundle, the infrastructure files are automatically copied to the output directory of the bundle. An option is provided for the generator to reinstall the infrastructure files when the files have been updated or new files have been added.

Automatic Compile and Build of the Generated Application Top of page

As part of the generate process, the generator automatically compiles and builds the generated solution and any necessary dll’s. This is achieved using MSBuild, the build platform from Microsoft used by Visual Studio. This means the Web Services are ready to test or deploy when the generation of the solution is complete.

For further details on all features and capabilities see the Online Documentation.