Creatio development guide
PDF
This documentation is valid for Creatio version 7.11.0. We recommend using the newest version of Creatio documentation.

How to create own configuration service

Glossary Item Box

General

Bpm'online service model implement a basic set of web-services that can be used for integration of bpm'online with external applications and systems. Examples of system services are EntityDataService.svc that provides possibilities for data communication with bpm'online through OData protocol and also ProcessEngineService.svc that can run bpm'online business processes from external applications.

You can create your user web-services in the configuration, used for implementation of specific integration tasks.

A configuration web-service is represented by RESTful-service, implemented on the basis of WCF technology.

Configuration service creation procedure.

To create your own web-services in the configuration, take the following actions:

  1. Create source code schema using C# language in the configuration.
  2. Add links to namespaces such as System.ServiceModel, System.ServiceModel.Web, System.ServiceModel.Activation in the ‘usings’ block.
  3. Create service class in the Terrasoft.Configuration namespace, create service class and place it with the [ServiceContract] and [AspNetCompatibilityRequirement] attributes with parameters (see implementation example).
  4. Add realization of service methods to created class. Each service method should be marked with the [OperationContract] and [WebInvoke] attributes with parameters (see implementation example).
  5. If necessary, you can implement additional classes, i.e. objective data types that will be processed by your service. Each class should be marked with the [DataContract] attribute and class fields should be marked with the [DataMember] attribute.
  6. Execute publication of source code schema.

After publication of schema, the created web-service will be available for calling of configuration schemas from a source code and also external applications. For more details about calling of configuration web-services see the How to call a configuration service article.

Configuration service example

This example shows the creation of a configuration service using one method. This method accepts one input parameter of string type and returns the string.

Full program web-service code is shown below:

// Configuration service class should be implemented in Terrasoft.Configuration name space. 
// If necessary, you can create your own workspace for a web-service but it should be 
// attached to Terrasoft.Configuration .
namespace Terrasoft.Configuration.CustomConfigurationService
{
    using System;
    using System.ServiceModel;
    using System.ServiceModel.Web;
    using System.ServiceModel.Activation;

    // Service class is marked with [ServiceContract] compulsory attributes and  
    // [AspNetCompatibilityRequirements] with parameters.
    [ServiceContract]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    public class CustomConfigurationService
    {
        // Service methods are marked with compulsory attributes [OperationContract] and 
        //[WebInvoke] with parameters.
        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,
        ResponseFormat = WebMessageFormat.Json)]
        public string GetTransformValue(string inputParam)
        {
            var result = inputParam + " + output string";
            return result;
        }
    }
}
© bpm'online 2002-2018.

Did you find this information useful?

How can we improve it?