Hi everyone,

 

if I have an interface marked as ServiceContract, and some method marked as OperationContract.

After that I have 2 classes implementing that interface and two different behaviours for a method in the interface.

How we can specify which implmentation we need to use when we hit that endpoint?

 

[ServiceContract]
public interface IServiceContract
{
    [OperationContract]
    void SomeMethod();
}
 
public class ImplementationClassA : IServiceContract
{
    public void SomeMethod()
    {
        // Implementation for Class A
    }
}
 
public class ImplementationClassB : IServiceContract
{
    public void SomeMethod()
    {
        // Implementation for Class B
    }
}

 

Like 0

Like

1 comments

Hello,

 

Do you have the possibility to create an instance of ClassA or ClassB when calling the service (based on some input parameters) and call the SomeMethod method from the correspondent class instance? It will call the method implemented in the correspondent class and your task will be achieved.

Show all comments

Hi Guys,

I have created a webservice using out the box webservice section and calling this webservice in business process.

Issue :- I have to pass collection inside collection to call the webservice. I am passing collection inside collection correctly but Creatio is not able to send collection data to webservice. Any idea how to resolve it?

 

Like 0

Like

1 comments

Hello,

 

It seems that the issue is that you are passing the first item read in the "Read bank account" element of the process (see [#Read bank account.First ite... in the "PartyAcctRelType" collection property settings from your screenshot). What should be done is modifying the "Read bank account" element and reading collection of records there, not the very first element from it:

And pass an actual collection of data read. This should work properly.

Show all comments

Hi community!

 

I have to integrate with a third-party tool that cannot send a request to the auth service and handle the cookies correctly.

 

Is there another method similar to webhooks using an API key in the URL or in the data itself?

 

Thanks in advance,

Robert

Like 1

Like

1 comments

Greetings, 

 

Possibly only through Oauth. 



Link to documentation: https://academy.creatio.com/docs/user/on_site_deployment/deployment_add…;



Best regards, 

Okrhan

Show all comments

Hy everyone,

 

I have encountered an issue where I am trying to call my webservice endpoint and I'm getting a 404 - Not found error.

I have tried calling it through a button's function and also through Postman app, but I get the same error.

There is no ..\Creatio Instance\Terrasoft.WebApp\0\rest directory where I have installed my Creatio locally.

My Creatio version is 8.0.6.3422.

 

 

Any idea how to fix this issue?

 

Like 0

Like

5 comments

Hi!

 

Have you made any recent changes to the webservice endpoint? Also, have there been any recent changes to the Creatio instance?

 

Looking forward to hearing from you!

Alla Blinova,

Hi Alla,

I haven't made any changes to the webservice endpoint since I have created it.



The process was:

1. Create the C# code object in the advanced settings

2. Code the webservice function

3. Compile the package

4. Edit the classicUI section page source code (Adding button to call the webservice)

5. Complie the package once again

 

Also, there weren't any changes regarding my Creatio instance.



Few weeks ago I had done the same steps on a cloud trial version where it worked just perfectly.



*Edit: Typo

Thanks!

 

Then we would suggest trying to call the webservice with a different record or data set to see if the issue persists.

If the issue continues, then try the source code generation and full compilation as a potential solution.

Alla Blinova,

I have tried to recomplie the individual package, then all the other packages and also tried source code generation but I had no success.



However I had a saved package where I have used a similar webservice. I installed this package on a trial cloud environment then locally.

The webservice call worked both on cloud and on local environment.



After this I exported my package which has the reported problem regarding webservice and installed it on cloud and it still doesn't work there.

 

Is there a method to check whether I have all the requirements to call the webservice, or is it possible to compare the two webservice/package components?

Hi Alla,

 

I have been able to resolve the issue.

I tried to call [Creatio instance]/0/rest/[package name]/[function call] instead of [Creatio instance]/0/rest/[webservice class]/[function call].

 

Thank you for your help.

Show all comments

Hi all, I have created a web service for parsing a document which is taking two request parameters:

 

  • Header Parameter : 

Key : “Authorization”

Value : (xyz 123456)  // just an example

 

  • Body Parameter :

Key : “file”

Value : (Base64 data)

 

When I test it within the Web Service section by providing both the parameters, it is working fine and giving the expected output in json format.

 

Now, when I use the same web service in Business Process and pass the parameters correctly by storing it in process parameters, the process always gives an error on that web service element.

 

Error is as follows:

 

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 am getting base64 data correctly from Business Process. Please help regarding this error.

 

Like 0

Like

2 comments

hi Prashant Jha

 

Creatio has its "JSON key parser" in a core assembly that works OOTB in the service section. Usually, it occurs in the Method & Body Parameters of a Web Service.



On looking at the exception, the input types are not matched here and one of the input types is Collection List.



Can we backtrack it by passing the parameters one by one? which means trying to send Parameter A, get the exception and then try passing Parameter A, and B to get the exception.



From the above information, I presume that the error lies in the below factors,

Body Parameter :

Key : “file”

Value : (Base64 data)

 

 

BR,

Bhoobalan Palanivelu

Hello,

 

This error could be due to incorrect handling of an array of parameters in the web service response (Result).

Try to remove parameter array from web service response.

Show all comments

I want to build an 'add' client wizard for our customer service to make it easy for them and also to prevent mistakes.

 

The first step would be to insert zipcode and housenumber, then it will make an API call to see how many adresses match these two parameter. 

 

The list that is returned, if the list is > 1 it should show you the information from the array and make you able to choose 1 of the options. 

 

If the list is 1 it should automatically pick the only available option.

 

I understand how to create the business process but combining this with a user interface is still difficult for me, is this even possible? 

Like 1

Like

3 comments

Hi, take a look at this article, I believe that there you can find a piece of useful information. It is written for the Freedom UI page, however, in earlier versions, you can just use XMLHttpRequest for sending the request, wait for a response, and process it.

The link somehow is broken now.

Pascal,

Here you are - link

Show all comments

Hi Team, 

 

I have a web service returning application/pdf type. I would like to use the web service integration and send that to the client side as base64. Any ideas on how I can convert the result of the WS to base64 in the business process?

 

Like 0

Like

1 comments

Hello,

Take a look at this conversation, it is very similar to your question.

Show all comments

Hi Team,



We are using an OOTB Webservice section to call the (GET) REST API endpoint and the response collection is captured in the "Response Parameter" of that web service. The response has a nested collection of data.

 

We are currently using the Script task to read the response data of a web service. Now it is required to get into the nested data set further and any insight on this would be helpful.



STEP 1: Web service Response

 

STEP 2: Script task to read web service response

var deliveries = Get<ICompositeObjectList<ICompositeObject>>("WebService1.Output_Out");
foreach(var delivery in deliveries){
//Delivery is again a nested data
//need to loop through the delivery (has parent record info and array of child record details)
}
 

Webservice Output:

{
   "output":[
      {
         "challan":[
            {
               "delivery_number":"DEL-251-253423",
               "delivery_id":1151109,
               "lines":[
                  {
                     "order_number":2011010049349,
                     "item_code":"RT3060-002GRL",
                     "grade":"A"
                  },
                  {
                     "order_number":2011010049359,
                     "item_code":"RT3062-002GRL",
                     "grade":"A"
                  }
               ]
            },
            {
               "delivery_number":"DEL-251-253430",
               "delivery_id":1151109,
               "lines":[
                  {
                     "order_number":2011010049369,
                     "item_code":"RT3060-002GRL",
                     "grade":"B"
                  },
                  {
                     "order_number":2011010049379,
                     "item_code":"RT3062-002GRL",
                     "grade":"B"
                  }
               ]
            }
         ]
      }
   ]
}



Need to traverse through the nested collection and one of the properties in the collection of values is array too {like section record information & Child record information} and then insert them into CRM table (Parent and child). Insight for processing this data set would be helpful.

 

 

 

Best Regards,

Bhoobalan Palanivelu.

Like 0

Like

3 comments

Hello,

In order to process the collection inside a collection, you need to do the following:

1) In the process, create a new parameter and add values to it from the web server response:

 

 

2) In your script task, you need to proceed this parameter and get values from it.

Dmytro Vovchenko,



Thanks for the information shared.

We were able to achieve processing the multiple nested collection through the below script and insert the Parent/Child collection sequentially.

 

List&lt;object&gt; deliveryItem = new List&lt;object&gt;();
List&lt;object&gt; lineItem = new List&lt;object&gt;();
var serviceOut = Get&lt;ICompositeObjectList&lt;ICompositeObject&gt;&gt;("Output");
 
foreach(ICompositeObject chall in serviceOut){
	if(chall.TryGetValue&lt;ICompositeObjectList&lt;ICompositeObject&gt;&gt;("Challan" , out ICompositeObjectList&lt;ICompositeObject&gt; curChallan)){
		foreach(ICompositeObject _challan1 in curChallan){
				curChallan1.TryGetValue&lt;string&gt;("Driver_contact_no" , out string Driver_contact_no); 
				deliveryItem.Add(Driver_contact_no);
 
				if(_challan1.TryGetValue&lt;ICompositeObjectList&lt;ICompositeObject&gt;&gt;("Lines" , out ICompositeObjectList&lt;ICompositeObject&gt; curLines)){
					foreach(ICompositeObject _Lines1 in curLines){
							_Lines1.TryGetValue&lt;decimal&gt;("Secondary_quantity_ctn" , out decimal Secondary_quantity_ctn); 
							lineItem.Add(Secondary_quantity_ctn);
				}	
			}
		}
	}
}

 

Also, we can utilize this without performing the Step 1 of Creating Nested Parameter Collection in Parameters of Business Process. Since the Web-Service already has the response parameter of same. But the parameter name from Webservice is always with a suffix _OUT





Iteration of Composite object collection is done through by following the Type<> in below Interface

ICompositeObjectList<TObject>

Interface ICompositeObject


 

 

 



BR,

Bhoobalan Palanivelu.

Show all comments

I am trying to save data from an API call, it returns a collection of records. I wish to save these into a table. I do not know how to loop through this collection and save each as a record. Please advise.

Like 0

Like

2 comments
Best reply

Hi Pascal,

 

This can be achieved via OOTB no-code tools of Business Processes.

The response collection of an API can be sent to a sub-process with parameter filled and it can be set to run sequentially so that all the response data will be successfully inserted into the table.



Here is the article, https://customerfx.com/article/working-with-collections-from-a-web-service-element-in-a-process-in-creatio/

 



BR,

Bhoobalan Palanivelu.

Hi Pascal,

 

This can be achieved via OOTB no-code tools of Business Processes.

The response collection of an API can be sent to a sub-process with parameter filled and it can be set to run sequentially so that all the response data will be successfully inserted into the table.



Here is the article, https://customerfx.com/article/working-with-collections-from-a-web-service-element-in-a-process-in-creatio/

 



BR,

Bhoobalan Palanivelu.

The subprocess method is very poor performance for larger datasets though, and so when we had this problem we ended up having to write C# for it. These aspects need to be improved by Creatio if their desire is to continue to push their platform as being effective at scale with no code solutions.

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