Hi Team,

I'm calling the custom web-service on the Customer Portal to fetch the role of the currently logged-in user: <strong>UsrUserInfoService/GetCurrentUserInfo</strong>. But the request is responding with 404 - Page Not Found error.

However, this service works as expected on the Employee Portal with the following endpoint: https://my.creatio.com/0/rest/UsrUserInfoService/GetCurrentUserInfo

I observed that the Requested URL differs slightly due to the presence of an additional path segment <strong>ssp</strong>, as shown below: `https://my.creatio.com/0/ssp/rest/UsrUserInfoService/GetCurrentUserInfo`

 

Thank you in advance

 

Like 0

Like

3 comments
Best reply

Add these attributes to your service class: 

[DefaultServiceRoute]
[SspServiceRoute]

Ryan

Add these attributes to your service class: 

[DefaultServiceRoute]
[SspServiceRoute]

Ryan

Hi Ryan,

After adding attributes, still getting compilation error below:


I am providing you with source code of service:


using Terrasoft.Web.Common;

using System.Web;

using Terrasoft.Core.Factories;

using System;

using System.Data;

using System.Data.SqlClient;

using System.Collections.Generic;

using System.ServiceModel;

using System.ServiceModel.Web;

using System.ServiceModel.Activation;

using Newtonsoft.Json;

using Terrasoft.Core;

using Terrasoft.Core.DB;

using Terrasoft.Common;

using Terrasoft.Core.Entities;

namespace Terrasoft.Configuration.UsrUserInfoService

{

    [ServiceContract]

    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]

    [DefaultServiceRoute]

    [SspServiceRoute

    public class UsrUserInfoService : BaseService

    {

       [OperationContract]

        [WebInvoke(Method = "GET", UriTemplate = "GetCurrentUserInfo", ResponseFormat = WebMessageFormat.Json)]

        public string GetCurrentUserInfo()

        {

            // Fetching Current Logged-in User Role

        }

    }

}

souresh khandelwal,

Sorry, forgot to also mention to add these usings: 

using Terrasoft.Web.Common;
using Terrasoft.Web.Common.ServiceRouting;

Ryan

Show all comments

Hi, I would like to know if there is a max amount of concurrent requests that Creatio is able to handle for custom web services defined in Creatio.

Is there any way to configure the max number of allowed concurrent requests to the same service on the technical user, the web service or the package containing the web service?

Like 0

Like

1 comments
Best reply

Hello,

There is no configurable maximum number of concurrent requests setting in Creatio for custom web services. The idea of a fixed limit isn't practical, because the performance impact of a request depends heavily on what the request actually does.

For example:

  • 1k lightweight requests that perform simple data retrieval or write operations may have minimal impact on the system.
  • Conversely, 1k complex or resource-intensive requests (e.g. involving multiple joins, integrations, or heavy business logic) could significantly degrade performance or cause failures under load.

Instead of a static limit, Creatio relies on the underlying infrastructure and available resources to dynamically manage the load. When system resources become constrained, the platform will naturally slow down or reject excess incoming requests to protect stability.

We recommend using a batching approach when integrating or calling custom services:

  • Start with batches of 2,000 to 20,000 requests, depending on the expected load per request.
  • Perform load testing to evaluate how the system responds. If the particular request is lightweight, you can safely increase the batch size.

This approach gives you flexibility and scalability without setting limits that may not reflect actual usage.

Hello,

There is no configurable maximum number of concurrent requests setting in Creatio for custom web services. The idea of a fixed limit isn't practical, because the performance impact of a request depends heavily on what the request actually does.

For example:

  • 1k lightweight requests that perform simple data retrieval or write operations may have minimal impact on the system.
  • Conversely, 1k complex or resource-intensive requests (e.g. involving multiple joins, integrations, or heavy business logic) could significantly degrade performance or cause failures under load.

Instead of a static limit, Creatio relies on the underlying infrastructure and available resources to dynamically manage the load. When system resources become constrained, the platform will naturally slow down or reject excess incoming requests to protect stability.

We recommend using a batching approach when integrating or calling custom services:

  • Start with batches of 2,000 to 20,000 requests, depending on the expected load per request.
  • Perform load testing to evaluate how the system responds. If the particular request is lightweight, you can safely increase the batch size.

This approach gives you flexibility and scalability without setting limits that may not reflect actual usage.

Show all comments

While configuring OAuth authentication to call external web services, I cannot find a way to set grant_type=client_credentials. Is there a way to make configuration use client_credentials instead of authorization_code grant_type?

I also tried to configure a web service to directly call the IdP access token endpoint passing the grant_type I need, but I was not able to find a way to send the body content-type in application/x-www-form-urlencoded format.

Do you have any suggestions to get the OAuth token using client_credentials?

Like 1

Like

1 comments
Best reply

Greetings!

There’s no way to get this using the basic method - it doesn’t support sending form requests.
You’ll need to write a task script for that.

It requires writing C# code that uses WebRequest to send the request.
For example:

public bool Execute(UserConnection userConnection)
{
    var tokenUrl = "https://your-creatio-instance.com/connect/token";
    var clientId = "your_client_id";
    var clientSecret = "your_client_secret";
    var request = (HttpWebRequest)WebRequest.Create(tokenUrl);
    request.Method = "POST";
    request.ContentType = "application/x-www-form-urlencoded";
    request.Accept = "application/json";
    var postData = $"grant_type=client_credentials&client_id={HttpUtility.UrlEncode(clientId)}&client_secret={HttpUtility.UrlEncode(clientSecret)}";
    var data = Encoding.UTF8.GetBytes(postData);
    try
    {
        using (var stream = request.GetRequestStream())
        {
            stream.Write(data, 0, data.Length);
        }
        using (var response = (HttpWebResponse)request.GetResponse())
        using (var reader = new StreamReader(response.GetResponseStream()))
        {
            var responseText = reader.ReadToEnd();
            var tokenResponse = JsonConvert.DeserializeObject<OAuthTokenResponse>(responseText);
            // if you want you can do something with tokenResponse.access_token            
            return true;
        }
    }
    catch (WebException ex)
    {
        if (ex.Response != null)
        {
            using (var reader = new StreamReader(ex.Response.GetResponseStream()))
            {
                var errorText = reader.ReadToEnd();
                // Here also you can log the error or display it
                Console.WriteLine("OAuth error: " + errorText);
            }
        }
        else
        {
            Console.WriteLine("WebException without response: " + ex.Message);
        }
        return false;
    }
}

Regards, 
Orkhan

Greetings!

There’s no way to get this using the basic method - it doesn’t support sending form requests.
You’ll need to write a task script for that.

It requires writing C# code that uses WebRequest to send the request.
For example:

public bool Execute(UserConnection userConnection)
{
    var tokenUrl = "https://your-creatio-instance.com/connect/token";
    var clientId = "your_client_id";
    var clientSecret = "your_client_secret";
    var request = (HttpWebRequest)WebRequest.Create(tokenUrl);
    request.Method = "POST";
    request.ContentType = "application/x-www-form-urlencoded";
    request.Accept = "application/json";
    var postData = $"grant_type=client_credentials&client_id={HttpUtility.UrlEncode(clientId)}&client_secret={HttpUtility.UrlEncode(clientSecret)}";
    var data = Encoding.UTF8.GetBytes(postData);
    try
    {
        using (var stream = request.GetRequestStream())
        {
            stream.Write(data, 0, data.Length);
        }
        using (var response = (HttpWebResponse)request.GetResponse())
        using (var reader = new StreamReader(response.GetResponseStream()))
        {
            var responseText = reader.ReadToEnd();
            var tokenResponse = JsonConvert.DeserializeObject<OAuthTokenResponse>(responseText);
            // if you want you can do something with tokenResponse.access_token            
            return true;
        }
    }
    catch (WebException ex)
    {
        if (ex.Response != null)
        {
            using (var reader = new StreamReader(ex.Response.GetResponseStream()))
            {
                var errorText = reader.ReadToEnd();
                // Here also you can log the error or display it
                Console.WriteLine("OAuth error: " + errorText);
            }
        }
        else
        {
            Console.WriteLine("WebException without response: " + ex.Message);
        }
        return false;
    }
}

Regards, 
Orkhan

Show all comments

i am trying to add a dropdown data by calling a webservice

does anyone have some advice?

 

Like 1

Like

2 comments

Hello,

Could you please describe your business idea in more detail? By dropdown data, do you mean a collection of parameters?

Mira Dmitruk,

it's a filter system that let's me select a set of options based on another set of options, basically a filter system for lookups based on lookups, what i tried to do is input a parameter by selecting from a field and obtaining the filtered options based on the selected option it's like

if Provinsi = DKI Jakarta 

then Kota = (Dropdown => Jakarta pusat, Jakarta Barat, Jakarta Utara, etc)

if Provinsi = Aceh

then Kota = (Dropdown => Aceh Selatan, Aceh Utara etc)

 

now im trying to find a way to filter the dropdown without going through them 1 by 1 by using an API and not Business Rules since i want to do it for 5 fields

Provinsi, Kota, Kecamatan, Kelurahan, Kode Pos

and each one needs to have the right option values

can anyone suggest a better way to handle this since i have no idea on how to do this

Show all comments

Hello

When creating a Web Service, the URI is embedded in the configuration and cannot be set with a System Setting like the values of the request parameters.

Usually the endpoints of the customer to integrate are located in "production" and "test" environments.

In Creatio if we need to integrate with the customer's web services we need two web service object: one for "test" and one for "production".

Why don't you allow the Web service configuration to set the URI with a System Setting thus there can be only one Web service object that automatically "points" to the proper customer's environment just changing the related system setting?

Thanks

4 comments

I completely agree. When using web services, the username and password (or API key etc) is already stored in the system settings. I would love for the setup/config instructions to only have one place users need to go to set up the values (in the system settings). As it is now, users have to go to the system settings to add those values, but then to the web services to add the URL.

Ryan

Ryan Farley,

Hello Ryan

If the web service is part of a package we create and deploy for our customer, the Web Service is "read-only" on the customer's platform then it's not possible to change the URL. That's why I'm asking to let this field to be set also from System Settings and not only manually.

Massimiliano

 

Massimiliano Mazzacurati,

It is still possible to change the URL of the web service, even if the web service is located in a locked/installed package. That is the one value it allows changing.

Ryan

Hello.

Thank you for your feedback. We completely agree that this is a very useful and much-needed functionality. Our development team already has a registered task to implement it, and based on your input, we have raised its priority to highlight its importance.

At the moment, the task is still in development, so we are unable to provide a specific ETA for its release.

Best regards, 
Antonii.

Show all comments

Hi Everyone, 

There is a sub process inside a main process, in which a web service (REST) is called but it is getting stuck due to operation timeout error (screenshot pasted). Our customer requested to bypass it if it is operation timeout so we checked that checkbox (Run current element in the background) in the subprocess. We thought that the main process now will not stop its execution even if the sub process stuck in the error state. But it is not and the main process is still stucking and not moving forward.

1. Following is the screenshot of the execution diagram of the main process where it got stuck at the subprocess - 

 

2. Following is the screenshot of the subprocess where the web service is called. 

3. Following is the screenshot of the error message - 

 

Can anyone please suggest how to handle this situation?

Thanks in advance.

Like 0

Like

3 comments

Sadly, there's no way to handle the timeout error in the process, it will only put the process in an error state - I do wish it was an option to handle that in the process rather than have the whole process error. 

Only option would be to increase the timeout for the web service call to possibly allow for the additional needed time. Otherwise, I've added script tasks that check for the service availability and can branch as needed to avoid the web service call, but that defeats the benefits of using the no-code web service components in the first place.

Ryan

Ryan Farley,

Thank you, if possible can you please share an example of how did you added script tasks that check for the service availability?

AS,

It was basically just C# that called one of the API methods and then set a param in the process so it knew to proceed or branch elsewhere. How that would look would depend on the API, but essentially you’re just writing code to call the API directly.

Show all comments

Hi Community,

 

We have this requirement, where we need to receive a complex json object and then store it in our database as a string, without using DataContracts.

 

To achieve this we though about using the "object" type and then serialize it into a string using JsonConvert.SerializeObject method. 

 

	  [OperationContract]
	  [WebInvoke(Method = "POST", UriTemplate = "/store", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
      public Response AddStore(object store) {
 
         Response response = new Response();
         response.MessageId = "1";
         response.Description = "Store Inserted!";
 
        string storeString = JsonConvert.SerializeObject(store, Formatting.Indented);
 
        var ins = new Insert(UserConnection)
        .Into("ImdStagingInArticle")
        .Set("ImdMessage", Column.Parameter(storeString))
        .Set("ImdStateId", Column.Parameter(new Guid("2d1dee23-058b-45fe-95a0-2e1612fc4261")));
 
        ins.Execute();
 
        return response;   
      }

 

However, the string is always empty. 

 

Since the json is to complex, the serializer cannot process the entire json data. 

 

We also tried to use WebOperationContext, but that doesn't work.

 

Can someone help us solve this issue? Did anyone have something similar?

 

Thank you.

Like 0

Like

7 comments

Hi,

 

First of all you need to make sure that you can convert the object into a string in general. Like create a Visual Studio project, add the logic to convert the object into a string using JsonSerializer like

 

string jsonString = JsonSerializer.Serialize(myObject); Console.WriteLine(jsonString);

 

And see the result. After the number of tests find the way when the data you pass is converted into the string and then start developing an additional logic of storing this data in the Creatio database using the insert query you used.

 

Alternatively find the way to make the object to have a constant set of keys so to be sure it will be converted to the string as needed.

Oleg Drobina,

 

After some changes I got it to work, by reading the raw body before the automatic parsing. However, this is working only on our Linux environment. As for for windows environment (Creatio Cloud), we are receiving some parse errors. 

 

      [OperationContract]
      [WebInvoke(Method = "POST", UriTemplate = "/article", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
      public Response AddArticle(string articleJson) {
 
        string result = "";
        Stream inputStream = HttpContext.Current.Request.Body;
 
        inputStream.Position = 0;
        using (StreamReader reader = new StreamReader(inputStream, Encoding.UTF8))
        {
            result = reader.ReadToEnd();
        }
 
        var parsedJson = JsonConvert.DeserializeObject(result);
        string jsonString = JsonConvert.SerializeObject(parsedJson, Formatting.Indented);
 
 
 
 
 
        Response response = new Response();
        response.MessageId = "1";
        response.Description = "Article Inserted!";
 
 
 
        var ins = new Insert(UserConnection)
        .Into("ImdStagingInArticle")
        .Set("ImdMessage", Column.Parameter(jsonString))
        .Set("ImdStateId", Column.Parameter(new Guid("2d1dee23-058b-45fe-95a0-2e1612fc4261")));
        ins.Execute();
 
        inputStream.Close();
 
        return response;  
      }

 

What could be the cause for such weird behaviour?

 

Thank you.
      

 

Pedro Pinheiro,

 

Well, it shouldn't happen. Maybe there is still some difference in the content we pass in the local machine and in the Windows machine?

Oleg Drobina,

 

The requests are the same for both local and cloud environments, except the address and credentials.

 

However, when I execute the request on the cloud environment I get this error:

 

 <p class="heading1">Request Error</p>
       <p>The server encountered an error processing the request. The exception message is 'This method or property is
           not supported after HttpRequest.GetBufferlessInputStream has been invoked.'. See server logs for more
           details. The exception stack trace is: </p>
       <p> at System.Web.HttpRequest.get_InputStream()
           at Terrasoft.Configuration.ImdArticleAPI.ArticleAPI.AddArticle(Object article)
           at SyncInvokeAddArticle(Object , Object[] , Object[] )
           at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp;
           outputs)
           at Terrasoft.Web.Common.ServiceModel.ThreadContextInitializer.Invoke(Object instance, Object[] inputs,
           Object[]&amp; outputs)
           at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
           at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
           at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&amp; rpc)
           at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</p>

 

Have you encountered something similiar? What could be the cause for such error?

 

Thank you.

 

Pedro Pinheiro,

 

Creatio doesn’t know how to serialize/deserialize object. If you change object to string in Response AddStore(object store) you will be able to parse it with JsonParser of your choice.

Kirill Krylov CPA,

 

The problem is, if I change it to string I can only send strings to this endpoint (The Json must be converted to a string). Because, if I try to send a Json Object I get "400 Bad Request".

 

 

 

Hello everyone,

 

I managed to get it working by receiving the body as a Stream instead of a String.

 

With this solution, I don't get the "400 Bad request" and I can process any Json object.

 

I don't know if this is the best solution, but it's working for now.
 

	  [OperationContract]
      [WebInvoke(Method = "POST", UriTemplate = "/article", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
      public Response AddArticle(Stream requestBody) {
 
        string result = "";
 
        using (StreamReader reader = new StreamReader(requestBody, Encoding.UTF8))
        {
            result = reader.ReadToEnd();
        }
 
        var parsedJson = JsonConvert.DeserializeObject(result);
        string jsonString = JsonConvert.SerializeObject(parsedJson, Formatting.Indented);
 
        Response response = new Response();
        response.MessageId = "1";
        response.Description = "Article Inserted!";
 
        var ins = new Insert(UserConnection)
        .Into("ImdStagingInArticle")
        .Set("ImdMessage", Column.Parameter(jsonString))
        .Set("ImdStateId", Column.Parameter(new Guid("2d1dee23-058b-45fe-95a0-2e1612fc4261")));
        ins.Execute();
 
        return response;  
      }

 

Feel free to give any feedback on this solution.

 

Thank you.

 

Show all comments

Hey,

I have followed all the steps in Implement a custom web service that uses anonymous authentication | Creatio Academy

 

Note:  Using Local Creatio Env, Creation:Energy 8.2v

 

`UsrAnonymousConfigurationService` File
 



Error: Internal Server Error

Like 0

Like

4 comments

Hello,

 

Please recreate the error and check both the Error.log file in the application logs (located at C:\Windows\Temp\Creatio by default) and the Windows events viewer logs to see the actual error message. This can be returned in case the services.config file was setup incorrectly or because of the incorrect setup in the Terrasoft.WebApp/Web.config file.

There might be an issue in the web.config file at the following line: `<add key="AllowedLocations" value="[Previous values];ServiceModel/UsrAnonymousConfigurationService.svc" />`.

 

I’m not sure what values should replace [Previous values].

Hello!

 

This issue might occur due to not enough setup in web.config on how to set it you can read here - https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/back-end-development/web-services/web-service-implementation/examples/web-service-anonymous-authentication#title-2145-4

 

Especially check 4-6 it must help you here.

Still not working.

Looking for response

Show all comments

why i get this error. i use update
... 0/odata/Contact(guid'123') to change number value

Like 0

Like

1 comments

Hello, 

The error you encountered, according to the analysis, was caused by the fact that the OData protocol takes some time to initialize. During this time, requests via the protocol may return an error. However, within 5 minutes of the request, the system successfully initialized the protocol.


Best regards, 
Orkhan

Show all comments

Hi everyone,

I’m working on a custom web service and tried integrating Npgsql. After encountering a "no namespace found" error, I took the following steps:

  1. Added the Npgsql.dll file to the Tearsoft.web/bin directory.
  2. Modified the web.config file with the following binding redirect:

    xml
     

  3. <dependentAssembly>
        <assemblyIdentity name="Npgsql" publicKeyToken="5d8b90d52f46fda7" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-8.0.5.0" newVersion="8.0.5.0" />
    </dependentAssembly>
  4. Restarted the IIS server.
  5. Flushed Redis via the Clio CLI.

After these steps, I'm now facing the following error: Could not load file or assembly 'System.Data.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. (Screenshot attached for reference)

I've already checked assembly binding logging, but I’m unsure how to resolve this error. Any suggestions or help would be appreciated!
 

Additional Context:

  • Working with PostgreSQL using Npgsql in the custom web service.
  • I made changes to the web.config file after adding the Npgsql DLL.


    this is the current state for my local instance .
     

Thanks in advance!

Like 0

Like

1 comments

Hi,

This issue requires a deeper analysis, and we advise you to create a case for Creatio support.

Thank you!

Show all comments