Hello Community,

 

When calling a custom web service that uses anonymous authentication from the browser using this link : 

"http://mycreatio.com/0/ServiceModel/UsrCustomConfigurationService.svc/G…"

 

The page does not seem to work.

 

Note :  we have an on premise Creatio instance on Linux based on .Net Core.

 

Bellow are the steps to reproduce the case:

 

The Academy guides on how to Create a custom web service that uses anonymous authentication for .NET Core : https://academy.creatio.com/docs/developer/back_end_development/web_ser…

This is the class indicated in the first step (that returns the contact ID by the contact name) : 

namespace Terrasoft.Configuration.KycCustomConfigurationService {

    using System;

    using System.ServiceModel;

    using System.ServiceModel.Web;

    using System.ServiceModel.Activation;

    using Terrasoft.Core;

    using Terrasoft.Web.Common;

    using Terrasoft.Core.Entities;

    using Terrasoft.Web.Http.Abstractions;

    [ServiceContract]

    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]

    public class KycCustomConfigurationService: BaseService {

        private SystemUserConnection _systemUserConnection;

        private SystemUserConnection SystemUserConnection {

            get {

                return _systemUserConnection ?? (_systemUserConnection = (SystemUserConnection) AppConnection.SystemUserConnection);

            }

        }

        /* The method that returns the contact ID by the contact name. */

        [OperationContract]

        [WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,

            ResponseFormat = WebMessageFormat.Json)]

        public string GetContactIdByName(string Name) {

            SessionHelper.SpecifyWebOperationIdentity(HttpContextAccessor.GetInstance(), SystemUserConnection.CurrentUser);

            var result = "";

            var esq = new EntitySchemaQuery(SystemUserConnection.EntitySchemaManager, "Contact");

            var colId = esq.AddColumn("Id");

            var colName = esq.AddColumn("Name");

            var esqFilter = esq.CreateFilterWithParameters(FilterComparisonType.Equal, "Name", Name);

            esq.Filters.Add(esqFilter);

            var entities = esq.GetEntityCollection(SystemUserConnection);

            if (entities.Count > 0) {

                result = entities[0].GetColumnValue(colId.Name).ToString();

                result = entities[0].GetTypedColumnValue(colId.Name); */

            }

            return result;

        }

    }

}

and this is the changes to the ..\Terrasoft.WebHost\appsettings.json file

"Terrasoft.Configuration.KycCustomConfigurationService": [

                                "/ServiceModel/KycCustomConfigurationService.svc"

                        ]



Thank you,

 

Like 0

Like

0 comments
Show all comments

In a Business Process, we are calling a Web Service using the Web Service Call element, but sometimes we will get a failure that we need to log to a custom table for action later. We really could do with as much information about the failure as possible, including being able to log out the parameters that the Web Service was passed so the support users can assess what happened without having to have trace logging turned on for the BP and digging into the BP log as well. I can't see any output on the web service call for that, but maybe someone else has found a way to get this info?

Like 2

Like

2 comments

Hi Harvey, we have similar needs, but no result, unfortunately. 

So, we log all parameters manualy before calling web service :(

Hello Harvey,



If you want to see the body of the request generated by the web service and the response that comes from the server - You can try to use Telerik Fiddler tool to capture requests that are being sent from the Creatio instance

 

But this advice is relevant only for local environments.

If the environment is on a local machine, you can connect Fiddler and test it.

 

In general, if you do not want to use data tracing for a process, we believe that this goal can be achieved through development. For example, a web service call will be made using a script task, in which you will process various responses from the server and write the information you need into a table using C# code.



Thank you.

Show all comments

Hello,

 

we use Web service element in our business process, where we set several parameters. For logging purposes we need to get JSON of request body, but there is no such option (I see only Response body)



How can we get request body from the Web service element?



Thanks.

Vladimir

Like 0

Like

3 comments

Hello,

Unfortunately, Web service element doesn't directly expose the request body for logging within the element itself. 

 

Hello, 

 

and no hidden workaround? Or any methods, which are used from request body generation, that we could use as well?



Kind regards,

Vladimir

Hello Vladimir,



You can try to use Telerik Fiddler tool to capture requests that are being sent.

Show all comments
Hello. 
Hello.

I need to send an image through an API to convert it to base 64, I tried to do it using the Web service tool but it does not allow me to place an image or file field to use it from the bpm, I was looking for some information and I saw that it could be done using a script, I just haven't found a way to do it. Could you help me with some example or idea so I can do this please?

 

 

 

Like 0

Like

1 comments

Hello Laura, 

 

Please refer to this article for more detailed information about such functionality.  

Also, similar questions have already been discussed in the below posts, please review them for the detailed information:

https://community.creatio.com/questions/there-option-send-image-file-re…

https://community.creatio.com/questions/file-type-request-parameter-res…

Please inform us in case of any questions!

Best regards,

Anastasiia

Show all comments

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