Hello,

 

I am trying to automate the gathering of data using some business process that perform API calls to one of our client private APIs. I have defined the WebServices with no problem like the one from this example:

 

 

And sending the test request with a valid API Key and Authorization token works perfectly. However, if I try to group all of this inside a business process I get an error that I don't know how to solve. This is the business process:

 

 

And the error that I get exactly on the web service call is this one:

 

 

The full error message states:

Terrasoft.Common.UnsupportedTypeException: Type "System.Collections.Generic.List`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" is not supported.

 

I have done some tests and I can confirm that the error only appears when I try to use a the valid Authorization token retrieved previously, and if I set any other value in that Web Service parameter I don't get the error but obviously the call fails because I am using and incorrect token.

 

The length of the token is 299 characters and as it is an authorization token, it must be preceded by the word "Bearer", so the full value that I am passing to that parameter is "Bearer " with a total length of 306 characters. I also tested using some random strings of length 500+ and the error doesn't show up, so it is not related to a limit of the parameter length. I also checked that the token I am passing is 'correct', i.e. no breaklines, weird characters (not UTF-8) or anything that could cause problems with the encoding of the string.

 

Therefore, I guess it is something related to the way Creatio builds the API request from inside the process, that is not the same as doing from a test request inside the Web Service...

 

Your help is highly appreciated.

Regards.

Like 0

Like

2 comments

Note: I have not tried yet to perform the same kind of requests inside a business process to another API (like a public one), but the error I am getting is not related to the API I am using, it must something related to the Creatio business process logic when invoking web services methods, regardless of the endpoint and the API specifications.

Hello,

 

I recommend that you create a support request.

Show all comments

Hi,

I'm trying to pass the result of below "json" (in script task),

var schema = UserConnection.EntitySchemaManager.GetInstanceByName("Account");

    var entity = schema.CreateEntity(UserConnection);

    entity.FetchFromDB(id);

    json = Terrasoft.Core.Entities.Entity.SerializeToJson(entity);

 

to a process parameter and that process parameter needs to be passed to web service element as an request object. Since, the structure of "json" variable might vary, how to send this to a process parameter and eventually to web service element?

 

Any suggestions would be appreciated. Thanks.

Like 2

Like

5 comments

public bool FetchFromDB(object keyValue, bool useDisplayValues = true)

All the `FetchFromDB` methods return a bool, you could test the call.

SerializeToJson(Entity)

Should work.

 

I've had a great deal of trouble with JSON in Creatio in the past.   What's the error you're getting?

Hi Gareth,

Thanks for your reply.

Is there a sample as how this can be sent to webservice element? Use case is to handle this as an object while sending it to webservice element and not as a string. For example, the request at the web service element should look like below.

{

"objectName" : "Contact",

"Payload" : { "Name" : "Halludeen", "Age" : 24 }

}

But, if I pass it as a string then it looks like,

{

"requestJson" : "{\r\n \"ObjectName\": \"Contact\", \r\n \"Payload\": { \"Name\" : \"Halludeen\"}"

}

 

Let me know if you have any suggestions for this.

 

Thanks again.

 

 

 

Halludeen,

The only JSON library I have been able to get to work in Creatio is 

`System.Text.Json.JsonSerializer`.  You have to call it with the full namespace rather than add the namespace in a `using` statement, see here.

 

You could use the `Serialize<TValue>(TValue, JsonSerializerOptions)` method.  The technique is essentially the reverse of the example linked to above, create an object for the deserialised JSON in a module (see example), add the namespace to your process, create an object with the data you want to serialise, and serialise it using the above method into a string.  Hopefully that will work!

Gareth Osler,

Having said the above, I wrote in June,

By way of an epilogue, while the `System.Text.Json` namespace is available in a trial, for some reason it was not available in the dev environment I was using.  However classes in the `Terrasoft.Common.Json` namespace were available.  I was able to use the `Deserialize<T>(String)` method of the Json class.  (Note at the time of writing the `DeserializeDictionary(String)` method has a bug in it and cannot be used.)

You may have to use the above class to do the same.

Show all comments

Hello team,

I have exposed an endpoint, but keep recieveing the 404 (Endpoint not found) when i call it from postman.

I have followed: https://academy.creatio.com/docs/developer/getting_started/develop_appl…

Is there any other prior configurations that need to be done in order to recieve a status 200?

Thank you

Sasori

Like 0

Like

3 comments
Best reply

Hello,

 

404 error means that there is no issue with the authorization or with the request type (GET\POST etc), it means that the endpoint you are calling doesn't exist (either because the link is not valid or because there is nothing behind this link). Also please try configuring the service as it's described here.

PS:

I am able to login. I recieve a status 200 when calling 

ServiceModel/AuthService.svc/Login.

I copy the generated BPMCSRF and place it to the Headers of the Custom web-service. But i keep recieving status 404

Hello,

 

404 error means that there is no issue with the authorization or with the request type (GET\POST etc), it means that the endpoint you are calling doesn't exist (either because the link is not valid or because there is nothing behind this link). Also please try configuring the service as it's described here.

Thank you for you advice Oleg. Issue was resolved

Show all comments

Hi,

 

I have begun playing with the web service integration capabilities within a process to send a message to a Teams channel. Obviously many use cases exist for having a message sent to a Team channel.

 

I have been able to successfully send a message to a channel, however I am having issues in managing the formatting of the message, so a clear title, and message body structure can be provided. Has anyone got any integration working with Teams that would be prepared to share how the web service, variables etc. are configured to allow formatted messages to be sent?

 

Thanks in advance.

Like 0

Like

6 comments

no one has?

 

Any guidance would be appreciated

Mark Roberts,



Could you please share how the implementation is done currently?

Also, have you tried about the content using <HTML>







BR,

Bhoobalan Palanivelu

 

Bhoobalan Palanivelu writes:

Mark Roberts,

Could you please share how the implementation is done currently?

Also, have you tried about the content using <HTML>

BR,

Bhoobalan Palanivelu

 

hi Mark Roberts,



Using the Content type as HTML  depicted below.

GraphServiceClient graphClient = new GraphServiceClient( authProvider );
 
var chatMessage = new ChatMessage
{
	Body = new ItemBody
	{
		ContentType = BodyType.Html,
		Content = "{\r\n  \"title\": \"This is an example of posting a card\",\r\n  \"subtitle\": \"&lt;h3&gt;This is the subtitle&lt;/h3&gt;\",\r\n  \"text\": \"Here is some body text. &lt;br&gt;\\r\\nAnd a &lt;a href=\\\"http://microsoft.com/\\\"&gt;hyperlink&lt;/a&gt;. &lt;br&gt;\\r\\nAnd below that is some buttons:\",\r\n  \"buttons\": [\r\n    {\r\n      \"type\": \"messageBack\",\r\n      \"title\": \"Login to FakeBot\",\r\n      \"text\": \"login\",\r\n      \"displayText\": \"login\",\r\n      \"value\": \"login\"\r\n    }\r\n  ]\r\n}",	}
};
 
await graphClient.Teams["{team-id}"].Channels["{channel-id}"].Messages
	.Request()
	.AddAsync(chatMessage);





BR,

Bhoobalan Palanivelu.

Bhoobalan Palanivelu,

Hi

 

Thanks for your reply. This is what I have done so far:

 

1. Created a new Web Service entry

2. Configured a single Method and populated top fields. I know this is correct as I can successful send a test request with just a single parameter line and it was received and displayed in my Teams channel

3. The issue I have is with the configuration of the Parameters, for which all but contentType I assume are Body parameters. The following screenshot is me playing with various structures and content entries, but I cannot get anything working :/

 

 

I am trying to send a message in a form similar to the following:

 

https://adaptivecards.io/samples/ActivityUpdate.html

 

I feel I am missing something straightforward in how this should be built within the Creatio Web Service definition, but the docs are not helping find it.

 

thanks

 

Mark

did you ever get this working?

keith schmitt,

No, I have been distracted with other things, so not got back to this. This would be a great blog for someone to write up and share!

Show all comments

Hi all

I have created a web service that accepts values from a third party server. Next, I need to transfer one value from the request to the section field.

Question:

How do I call my finished web service in C#?

Like 0

Like

4 comments

Hi,

Are you talking about a service created in the configuration or in the "Web services" section?

Dmytro Vovchenko, in the web services section

 

the question is how to set up its call in c#, so that in the future to use its result in one of the fields of the section

 

Alexandr Bezbozhnov,

As far as I know, currently, there is no direct way of running this sort of web service from code. However, you can run it inside a business process and you can run this process inside C# code using

ProcessEngineService.svc, with it you even can get the result values of the process.

Show all comments

Hello all,

 

I am trying to enable access for a portal user to trigger a service within Creatio. I'm following the steps as listed in this academy page but when I try to declare _baseService and publish, I receive an error saying that GlbInterviewService is "'GlbInterviewService' is a namespace but is used like a type"

 

namespace Terrasoft.Configuration.KeenGlbInterviewService
{
	using System;
	using System.IO;
	using System.Collections.Specialized;
	using System.Globalization;
	using System.Runtime;
	using System.Runtime.Serialization;
	using System.ServiceModel;
	using System.ServiceModel.Web;
	using System.ServiceModel.Activation;
	using System.Threading;
	using System.Threading.Tasks;
	using System.Web;
	using Terrasoft.Core;
	using Terrasoft.Core.Factories;
	using Terrasoft.Web.Common;
    using Terrasoft.Web.Common.ServiceRouting;
 
	#region Class: KeenGlbInterviewService
 
	[DefaultServiceRoute, SspServiceRoute]
	[ServiceContract]
	[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
	public class KeenGlbInterviewService : BaseService
	{
 
		#region Methods: Public
		private static readonly GlbInterviewService _baseService = new GlbInterviewService();
 
		[OperationContract]
		[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
		public InterviewServiceResponse Start(InterviewServiceRequest request)
		{
			return _baseService.Start(request); 
		}
 
		[OperationContract]
		[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
		public InterviewServiceResponse Complete(InterviewServiceRequest request)
		{
			return _baseService.Complete(request);
		}
 
		#endregion
 
	}
 
	#endregion
 
	#region DataContract
 
	[DataContract]
	public class InterviewServiceResponse : ConfigurationServiceResponse
	{
		[DataMember(Name = "isSuccess")]
		public bool IsSuccess {get; set;}
	}
 
	[DataContract]
	public class InterviewServiceRequest
	{
		[DataMember(Name = "interviewId")]
		public Guid InterviewId { get; set; }
	}
 
	#endregion
 
}

From what I can tell I've set everything up exactly as the article says but I still receive the error. Though they declare _baseService the same way. Any suggestions as to what I could be doing wrong?

Like 0

Like

3 comments
Best reply

Kevin Brady,

 

Ok, according to the error you should have the Terrasoft.Configuration.GlbInterviewService namespace in your system, but you try to create a new method that has the same name as the namespace (as well as your current class KeenGlbInterviewService has the same name as your namespace Terrasoft.Configuration.KeenGlbInterviewService). So theoretically adding "using Terrasoft.Configuration.GlbInterviewService" to your code should fix this issue, but still you need to rename either classes or namespaces since they shouldn't have the same name.

Hello Kevin,

 

I used the same exact code and created a source code in my local app and it didn't return error messages. Try recreating it and also check if the error message is returned from the source code you've shared.

Oleg Drobina,

I recreated the code and also tried pasting the above code directly back into Creatio to ensure that there weren't any changes that occurred in creating this post and I still received the error.

Kevin Brady,

 

Ok, according to the error you should have the Terrasoft.Configuration.GlbInterviewService namespace in your system, but you try to create a new method that has the same name as the namespace (as well as your current class KeenGlbInterviewService has the same name as your namespace Terrasoft.Configuration.KeenGlbInterviewService). So theoretically adding "using Terrasoft.Configuration.GlbInterviewService" to your code should fix this issue, but still you need to rename either classes or namespaces since they shouldn't have the same name.

Show all comments
Idea
Discussion

Hi all,

I tried to implement a web service with the configuration section in Creatio for SAP business one Service Layer and the default port for service layer is 50000. URL is the Https://myserver.com:50000/ Configuring the webservice Creatio omitted last 0 and the computed Uri was 0/b1s/... instead of /b1s/ and the connection try was resulting unable to connect because it was attacking on port 5000. I had to change the settings of SAP Service Layer for 5000 then connection succeeded. As we are on prem with SAP no issue to patch but clients on cloud would have issues.

 

is it possible to fix this issue in Creatio accepting 5 digits for port number?

 

Thanks in advance,

Franck

3 comments

Hi,

There are no restrictions on port length in Creatio.



Try to create the web service again and check how it works.

Perhaps the service settings are cached.

Hi Nikita,

You can reproduce like this:

Create a new web service with the port 50000:

https://127.0.0.1:50000/mywebservice

 

Then click ok, you will see that the URI is truncated and a 0 has been put to the method. You may try to change the values but the system would not save it properly. Running on 7.18.3 same behavior on 8.0.3 on demo instance.

Thanks,

Franck

Thanks, I reproduced the described behavior.

 

You can change the service URL and method settings manually.

I changed it manually, and everything saved correctly for me.

Show all comments

Hi Community!!!

I used built in web service configuration to configure an integration with third party app.

The JSON that third party app receives looks like this:

{

  "url": "https://test",

  "events": ["a","b"]

}



The configuration for the events parameter into web service is as shown in the image below:

My issue is when I try to call this Web Service/Method from a Business Process. I cannot send the correct values for the events parameter. I tried several options for example: read a lookup values, create list or collection in a script task, etc. but I couldn't achive the goal.

The image below shows how the parameter is requested on the business process:

 

Below I show the trace with an example of the values I try to pass to the paramter:



"Parameter": "Events",

            "Value": {

                "Before execution": [

                    {

                        "Name": "invitee.created"

                    },

                    {

                        "Name": "invitee.canceled"

                    }

                ],

 

Any recomendation?

Regards.

 

 

 

 

Like 0

Like

3 comments

Hello,

You can send  your values using a collection.

The values of collection parameters of a [ Call web service ] process element can be mapped to the nested parameters of another collection of a [ Read data ] or [ Call web service ] process element .Additionally, each item of the collection can be mapped to an individual subprocess instance in the [ Subprocess ] element.



 

You can find more detailed information on the academy website:

https://academy.creatio.com/docs/user/bpm_tools/process_elements_refere…

Cherednichenko Nikita,

Thank you! I tried it but the result is something like this:

 

[

                    {

                        "Name": "invitee.created"

                    },

                    {

                        "Name": "invitee.canceled"

                    }

                ],

The expected value is 

[invitee.created","invitee.canceled"]

 

How can I achive this?

Regards.

Hello,

The code

[

                    {

                        "Name": "invitee.created"

                    },

                    {

                        "Name": "invitee.canceled"

                    }

],

Is seen like : [{"Name": "invitee.created"}, {"Name": "invitee.canceled"}].

But, in your case, I believe you can use the parameter value "Collection of values"

 

Show all comments

Hello,



I want to make a cascading dropdown. For example; user selects City, then County, then District, then Street... I want to fill the dropdowns from external web service whenever user selected previous dropdown.



How should i go about it?



Like 3

Like

3 comments

Hello Ensar,

Loos like you just need to add a filter to the column based on the other column value.

You can do it by adding attribute on the needed column.

For example:

"Transport": {
                "dataValueType": Terrasoft.DataValueType.LOOKUP,
                "lookupListConfig": {
                    "filters": [
                        function() {
                            var filterGroup = Ext.create("Terrasoft.FilterGroup");
                            filterGroup.add("WhatWeight",
                                Terrasoft.createColumnFilterWithParameter(
                                    Terrasoft.ComparisonType.GREATER,
                                    "[StTransport:Id].StMaxWeight",
                                    this.get("Weight")));
                            return filterGroup;
                        }
                    ]
                }

In this example we have column "Transport" and we wont to display values where their column "StMaxWeight" is greater that out column "Weight".

Thanks for your reply Dmytro Vovchenko,

 

Filtering is ok. At the same time, i need to get data from external web service not database. Is there a way binding lookups to external web service dynamically?

Not quite understand what are you trying to do but I think you can store the value from your web service in the schemas attribute and then work with it. To make it work you just need to somehow get the needed value from the web server in the schema code. 

Show all comments

Good day community,

 

I'm having trouble with adding the correct JSON path for my request body.

 

I have to send a POST request with the following JSON below:

{
  "members": [
    {
      "@odata.type": "--TYPE HERE--",
      "user@odata.bind": "--USER 1 HERE--"
    },
    {
      "@odata.type": "--TYPE HERE--",
      "user@odata.bind": "--USER 2 HERE--"
    }
  ]
}

This is how my parameter structure looks:

Generated JSON here:

{
	"chatType": "oneOnOne",
	"members": [
		{
			"@odata": {
				"type": "--TYPE HERE--"
			},
			"user@odata": {
				"bind": "--USER 1 HERE--"
			}
		}
	]
}

The problem with this structure is that it generates a nested key for type under @odata, and for bind as well. I don't wan't this to happen if possible.

 

Is there any way to get this to work using parameters in web service? Or would my only resort be to generate the request body via script?

Like 0

Like

2 comments

Hello,

 

The body of the webservice seems to be generated properly since "members" is the array of objects "@odata" and "user@odata". The request was properly parsed and that's why you saw the result as on the screenshot. If this structure won't work in your business case then a separate script task should be created to sent the request.

 

Best regards,

Oscar 

Hi Oscar,

 

Thank you for you response.

 

In forming the json path, I would have made it as $.[members]["@odata.dataType"] or $.[members]["user@odata.bind"], but I'm guessing that this is not possible using the built-in function (nesting parameters) in Creatio?

 

I think I'll instead be resorting to creating a script task for this.

 

Thank you!

 

Lyle

Show all comments