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
Best reply

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

1 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.

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

Hi Team, 

 

I have a webservice created with the designer in the web services setup integrations and I would like to call it from a client schema. There is any way to perform that?

Like 0

Like

1 comments

Hi Federico,

As far as I know, there is no direct way to call this type of web service from a client side, however, there is a small trick you can do. You can configure a business-process to run your service and on the client side, you can run this process.

Also, I will registrate your suggestion to our R&D team, thank you for giving us ideas to improve.

Show all comments

Hi Team,



In Order section, we can place an order against an "Account".

In "Account" we can set a price list for a particular account.



While adding products in the Order section for a corresponding account, the products are displayed based on the price list column set in that account. This is achieved by calling a web service "PriceListService".

PriceListService.cs

	[OperationContract]
		[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,
			ResponseFormat = WebMessageFormat.Json)]
		public Guid GetPriceList(Guid accountId) {
			var priceListPicker = ClassFactory.Get<IPriceListPicker>(new ConstructorArgument("userConnection",
				UserConnection));
			var	preSetPriceList = priceListPicker.GetPriceList(accountId);
			return preSetPriceList != default(Guid)
				? preSetPriceList
				: priceListPicker.GetPriceList(UserConnection.CurrentUser.AccountId);
		}



But which client module is calling this web-service while adding products?



The responsible module must be an order product detail schema or page or the base page in this hierarchy. Please guide me on the module and the place where the web service is called.







BR, 

Bhoobalan Palanivelu.

Like 0

Like

5 comments

That service is being called from BaseOrderPage. In that schema there is a function that calls it named "initializePredefinedPriceList" (the actual service being called is defined in "getPriceListServiceConfig")

Ryan

Ryan Farley,



Thanks, Ryan!



Hopefully, this Base Order page is allowed in Replacing View model. It can override the getPriceListServiceConfig calling method and define a custom web service to filter the products with custom parameters.





BR,

Bhoobalan Palanivelu.

Bhoobalan Palanivelu,

Yes, you should have no issue creating a replacing schema for BaseOrderPage and then override the methods as needed.

Ryan

Ryan Farley,



Thanks!



When the (+) is clicked in Product detail (in the order section) it opens a Product List page though the detail is editable. Where is the code for add record icon and it's not available in "OrderProductDetailV2" ? and how does this product list page is opened (ProductSelectionSchema).



Step 1: Which client schema page has this add event?



Step 2: How does the Account & Price List filter is applied to Product List page.





Insight on the Schema's name and the place where the code triggering the corresponding action will be helpful.





BR,

BHoobalan Palanivelu.

Bhoobalan Palanivelu,

Hello Bhoobalan

Please do you have a suggestion on how to implement the Product Catalog that appears in the order Section, for opportunity Products in Opportunity section. Your suggestions are much appreciated !

Show all comments

Hi there,

 

I have a requirement to trigger a business process with a parameter value from an anonymous web service and get errors while publishing the code in the Creatio environment. Below I have mentioned the complete code of the web service and the error screenshot of the error.

 

Note: I have pre-created the business process with the parameter and written the web service.

I referred other community articles such as 

https://community.creatio.com/articles/web-service-without-authorizatio…

https://community.creatio.com/questions/calling-business-process-parame…

These codes currently seem to be outdated and not working in the Atlas version of creatio. Please give me suggestions to resolve this issue.

 

Code :

 

/* The custom namespace. */

namespace Terrasoft.Configuration.WSO2WSConfirmationServiceNamespace

{

    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.Core.Process;

    using Terrasoft.Core.Process.Configuration;

    [ServiceContract]

    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]

    public class WSO2WSConfirmationService : BaseService

    {

        /* The link to the UserConnection instance required to access the database. */

        private SystemUserConnection _systemUserConnection;

        private SystemUserConnection SystemUserConnection

        {

            get

            {

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

            }

        }

        /* The method that returns the confirmation of buttons. */

        [OperationContract]

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

        ResponseFormat = WebMessageFormat.Json)]

        public string ConfirmationService(string guid, bool status)

        {

            new Guid(guid);

            string result = "Guid is missing";

            if (!string.IsNullOrEmpty(guid)) {

                if (status == false)

                {

                    var manager = UserConnection.ProcessSchemaManager;

                    var processSchema = manager.GetInstanceByName("WSO2Process_3c0d24a");

                    var moduleProcess = processSchema.CreateProcess(UserConnection);

                    if (processSchema.Parameters.ExistsByName("ProcessSchemaConfirmationId"))

                    {

                        moduleProcess.SetPropertyValue("ProcessSchemaConfirmationId", guid);

                    }

                    moduleProcess.Execute(UserConnection);

                    /*ProcessSchema schema = UserConnection.ProcessSchemaManager.GetInstanceByName("WSO2Process_3c0d24a");

                    //schema = UserConnection.ProcessSchemaManager.GetInstanceByUId(leadManagementProcessUId);

                    //different engines for interpretable and compiled BP

                    bool canUseFlowEngine = ProcessSchemaManager.GetCanUseFlowEngine(UserConnection, schema);

                    if (canUseFlowEngine)

                    {

                        var flowEngine = new FlowEngine(UserConnection);

                        var param = new Dictionary();

                        param["ProcessSchemaConfirmationId"] = guid.Id.ToString();

                        flowEngine.RunProcess(schema, param);

                        

                    }

                    else

                    {

                        Process process = schema.CreateProcess(UserConnection);

                        process.SetPropertyValue("ProcessSchemaConfirmationId", guid.Id);

                        process.Execute(UserConnection);

                    }*/

                    result = "Response posting is cancelled, You can close this tab";

                }

                else {

                    result = "WSO2 endpoint intergration is pending";

                

                }

            }



            

            return result;

        }

    }

}

File attachments
Like 0

Like

1 comments

Found the answer for this mentioned issue, Please refer to the code below. Using IProcessExecutor, this can be simply achieved in the 8.0 version.

/* The custom namespace. */

namespace Terrasoft.Configuration.WSO2WSConfirmationServiceNamespace

{

    using System;

    using System.ServiceModel;

    using System.Collections.Generic;

    using System.ServiceModel.Web;

    using System.ServiceModel.Activation;

    using Terrasoft.Core;

    using Terrasoft.Web.Common;

    using Terrasoft.Core.Entities;

    using Terrasoft.Core.Entities.Events;

    using Terrasoft.Core.Process;

    using Terrasoft.Core.Process.Configuration;

    [ServiceContract]

    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]

    public class WSO2WSConfirmationService : BaseService

    {

        /* The link to the UserConnection instance required to access the database. */

        private SystemUserConnection _systemUserConnection;

        private SystemUserConnection SystemUserConnection

        {

            get

            {

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

            }

        }

        /* The method that returns the confirmation of buttons. */

        [OperationContract]

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

        ResponseFormat = WebMessageFormat.Json)]

        public string ConfirmationService(string guid, bool status)

        {

            try

            {

                new Guid(guid);

                string result = "Guid is missing";

                if (!string.IsNullOrEmpty(guid))

                {

                    if (status == false)

                    {

                        {

                            // getting  IProcessExecutor

                            IProcessExecutor processExecutor = SystemUserConnection.ProcessEngine.ProcessExecutor;

                            // List of input parameters

                            var inputParameters = new Dictionary<string, string>

                            {

                                ["ConfirmationId"] = guid.ToString(),

                            };

                            //code of the process

                            string processSchemaName = "WSO2Process_3c0d24aCustom1";

                            //execute the process

                            ProcessDescriptor processDescriptor = processExecutor.Execute(processSchemaName, inputParameters);

                            //return processDescriptor;

                        }

                        

                        result = "Response posting is cancelled, You can close this tab";

                    }

                    else

                    {

                        result = "WSO2 endpoint intergration is pending";

                    }

                }

                return result;

            }

            catch (Exception ex)

            {

                return "GUID error - " + ex.Message; 

            }

            

        }

    }

}

 

 

Thanks

Show all comments

I created a custom web service to accept xml from one of our lead aggregators. However, it is not deserializing the request body, and all I get in response is a Null Object Reference error. Am I missing something?

 

My custom web service:

namespace Terrasoft.Configuration.UsrMyLeadImportNamespace
{
    using System.Collections.Generic;
    using System.IO;
    using System.Xml;
    using System;
    using System.Runtime.Serialization;
    using System.ServiceModel;
    using System.ServiceModel.Activation;
    using System.ServiceModel.Web;
    using System.Xml.Serialization;
    using Core;
    using Core.DB;
    using Terrasoft.Web.Common;
 
    [XmlSerializerFormat]
    [ServiceContract]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    public class UsrMyLeadImport: BaseService
    {
		private SystemUserConnection _systemUserConnection;
		private SystemUserConnection SystemUserConnection
		{
			get
			{
				return _systemUserConnection ?? (_systemUserConnection = (SystemUserConnection)AppConnection.SystemUserConnection);
			}
		}
		// Service operation.
		[OperationContract]
		[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "new")]
		public MyResponse New(LeadInformation leadInformation)
		{
			var response = new MyResponse();
			response.ResponseStatus = "Tracking Number is => " + leadInformation.TrackingNumber;
			return response;
		}
	}
 
 
	[XmlRoot(ElementName = "LeadInformation")]
	public class LeadInformation
	{
		[XmlElement(ElementName = "TrackingNumber")]
		public int TrackingNumber { get; set; }
 
	}
 
	[DataContract(Namespace = "")]
	[Serializable]
	public class MyResponse
	{
		[DataMember]
		public string ResponseStatus { get; set; }
	}
}

Request Body:

<LeadInformation>
    <TrackingNumber>12345</TrackingNumber>
</LeadInformation>

 

Like 0

Like

1 comments
Best reply

I've performed the same setup (additionally to the code you've shared, registered the service as anonymous) and sent the following request in Postman:

As you can see the result is correct so the issue is somewhere in the request you send or in the service settings. You need to double-check them.

I've performed the same setup (additionally to the code you've shared, registered the service as anonymous) and sent the following request in Postman:

As you can see the result is correct so the issue is somewhere in the request you send or in the service settings. You need to double-check them.

Show all comments

Hi community,



For an integration, I have the following JSON request parameter :



{

  "externalID": "57",

  "nomDuClient": "Simple text example",

  "nomDelOpportunite": "Simple text example",

  "calculateurs": [

    "57",

    "61"

  ]


}




Let's have a further look to the "calculateurs" field. When setting the WebService into Creatio with the automatic request paramters, I get something like this :



image.png

I have "Text" data which is an Array. Everything's fine. 



Now, if I use the "WebService" element in the business process, it automatically sets something like this :



image.png



This structure will give a parameter that will look at something like :



"calculateurs": [



{ "name of the element": "value of the first element" }, { "name of the element": "value of the second element" } 



]



Which will be an array of structure of strings and not just an array of string.



Furthermore, when trying to get a collection through looping into a subprocess, the collection of parameters given by the subprocess will look at something like this :



image.png



They will be an array of structure of strings. 



It has been hours that I am trying to populate my WebService parameter as just an array of strings.

How can I achieve that ?



Many thanks,

Jonathan

Like 0

Like

5 comments

Dear Jonathan,

 

Unfortunately, there is no OOB functionality for transferring data sets (IsArray type) to web service parameters by not the 'Read data" element.

 

 We have already registered the idea for our R&D team to implement this functionality in further releases. I will assign your case to this project in order to increase its priority.  

 

Best regards,

Bogdan

Bogdan,

 

I have this situation when setting up the Web Service :

 

When i call the WebService process element, the field automatically fills like this :

 

And with this element, it is impossible to send an array of strings like set in the webservice request parameter isn't it ?

 

If we have a JSON like :

 

"Assistant": [

{

"string": "hello world"

}

]

 

Where the "string" value is set in "Sélectionner la valeur" on the screenshot above. So there is really no way of sending an array of strings, really ?

 

When I test the request directly from the WebService section, I can just add lines to the array and manually setting values into it. Isn't there a way to do it automatically ?

 

Let me ask the question in a different way, how could I send an array of strings via the "Read data" element of the business process ?

 

Many thanks,

Jonathan

Jonathan Quendoz,

 

If the request parameter is a collection (the “Is array” checkbox is selected in the properties of the parameter at the web service record), the nested collection parameters will be displayed under the collection name in the process element parameters (Fig. 3). For example, Creatio “batch query” service can insert several records (e.g. contacts) to Creatio. To do this, the service would require information to write into the fields of each inserted record (e.g. contact names and types). In this case, you can pass the values as a request parameter of an array type, where “Name” and “Type” will be nested parameters and each instance of the collection would represent data for a separate contact record.

 

 

The values of collection parameters of one [ 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.

 

 

 

The parameters of the collection of process elements can be mapped to the process parameter of the “Collection of values” data type.

 

Please refer to the article here.

 

Best regards,

Bogdan

 

Jonathan Quendoz,

Hi! How are you? I'm running on the same problem. Did you find a solution? Appreciate it.

Regards

Uriel Nusenbaum,

 

Hi Uriel ! 

 

Unfortunately, I did not found a solution to this problem. 

I asked to the WebService supplier to adjust their webservice to have an array of structure of strings as json paramater instead of just an array of strings.

 

At the moment, I think that besides calling a WebService via C# in back-end, it is not possible to send an array of strings as parameter. It should really be reworked from Creatio.

 

You can only send an array of a structure of strings via a sequentiel sub-process.

 

Please, if you have any questions about this, do not hesitate.

 

Best regards,

Jonathan

Show all comments

Hi,

Please provide the procedure for call a web service in mobile application.

Thanks

Like 0

Like

0 comments
Show all comments