Is there a way to capture the Request message from a Call Web Service activity for debugging?

Like 0

Like

3 comments

Dear Glenn,

You can use Fiddler to catch requests that are being sent to and from the application and use it for debbuging. But you will be able to do it starting from 7.13.2 version of the applciaiton. Until that you can either create the functionality and then use it after the upgrade or create the request on c# via a script task element.

Best regards,

Oscar

Oscar Dylan,

Both bpm'online and the service are in cloud, so I cannot use fiddler.  What is the target release for 7.13.2?

Dear Glenn,

You will be able to use fiddler to catch requests even if the instance is located on-cloud. As for 7.13.2 version - please take a look at release notes here https://academy.bpmonline.com/documents/bpmonline-release-notes-7-13-2.

Best regards,

Oscar

Show all comments

Hi Community,

we have the following problem, when we make a data load through the consumption of a "REST - WebService"

We would like to know how we could fix the "parse" error so that the execution does not fall ?. This happens when reading a JSON from the WebService.

 

 

 

Newtonsoft.Json.JsonException: Unexpected character while parsing path: 

   at Newtonsoft.Json.Linq.JsonPath.JPath.ParseMain()

   at Newtonsoft.Json.Linq.JToken.SelectToken(String path, Boolean errorWhenNoMatch)

   at Terrasoft.Services.Runtime.JsonResponseBodyParser.FillServiceParameterValues(IEnumerable`1 parameters, JToken responseToken, Dictionary`2 parameterValues)

   at Terrasoft.Services.Runtime.JsonResponseBodyParser.FillComplexArray(ServiceParameter parameter, JArray jsonArray)

   at Terrasoft.Services.Runtime.JsonResponseBodyParser.FillArrayValues(JToken token, ServiceParameter parameter, Type valueType)

   at Terrasoft.Services.Runtime.JsonResponseBodyParser.FillServiceParameterValues(IEnumerable`1 parameters, JToken responseToken, Dictionary`2 parameterValues)

   at Terrasoft.Services.Runtime.JsonResponseBodyParser.Parse(String body, Dictionary`2 dataAdapters)

   at Terrasoft.Services.Runtime.ServiceClientResponse.FillInBodyParameters(Dictionary`2 parameterValues)

   at Terrasoft.Services.Runtime.ServiceClientResponse.ParseResponse()

   at Terrasoft.Services.Runtime.ServiceClientResponse.get_ParameterValues()

   at Terrasoft.Services.WebServiceUserTaskImplementation.FillResponseParameters(IServiceClientResponse response, ProcessWebService userTask, IProcessParametersMetaInfo schema)

   at Terrasoft.Services.WebServiceUserTaskImplementation.Execute(ProcessWebService userTask, ProcessExecutingContext context)

   at Terrasoft.Core.Process.ProcessActivity.Execute(ProcessExecutingContext context)

Like 0

Like

1 comments

Hello,



Basically, the error means that system receives an unexpected json object from web service.



If you use business process element "call web service" to make requests to external web service you should check web service settings.



In case you make a request to a web service via script task i.e. c# code, you should check your code for incorrect casts. 



Also you can simply catch requests and responses from web services via fiddler. With fiddler you are able to view headers, body and other request parameters.



Best regards,

Alex

Show all comments

When trying to call a web service from the BPM'Online platform, the process throws the following error: 

we assume that the error is due to the immense size of the JSON that we try to read from the external web service, so that the response would exceed the processing capacity limits of the webservice module of the bpm'online tool.

Our consulate is, if there is a way to increase the data processing limit of the bpm'online web service module in terms of reading the JSON delivered by the external web service.

We estimate that approximately 6 GB of RAM is needed to process the desired volume of data.

Like 0

Like

2 comments

It doesn't seem to be a memory issue. Bpm'online provides up to around 8 GB RAM in critical moments and 4 GB by default. Anyway, If the application consumes more than around 8 GB RAM, IIS restarts it automatically. If you need more resources, please contact your account manager and the limits will be increased. 

It seems like the issue is related to a wrong JSON format. However, since the JSON is huge you'll not be able to debug it. In this case I recommend to create your own web service according to the article by the link below. 

https://academy.bpmonline.com/documents/technic-sdk/7-13/how-create-cus…

This way in case of the exception message you'll be able to create your own logging or debug the service on a local copy of the application. 

Please be aware of the fact that during the integration process that consumes almost all available RAM users might face performance issues. 

Thank you very much for the reply; it was indeed an error of the JSON that was being called, since it contained Null fields that did not correspond.

Show all comments

I created a custom service following this guide: https://academy.bpmonline.com/documents/technic-sdk/7-12/how-create-custom-configuration-service. The GET method works as expected but when I created a POST endpoint, the only response I get is 403. Actually sending POST request to any endpoint ends up with this error. My class looks like this:

[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
public class UsrCustomService: BaseService
{
	[OperationContract]
	[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
	public bool PostTest()
	{
		return true;
	}
 
	[OperationContract]
	[WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
	public string GetTest()
	{
		return "Hello world";
	}
}

Do you know how can I fix it?

Like 0

Like

7 comments

Dear Carlos,

This error indicated that you are forbidden to insert into the object. This usually happens, when the user, whose login details you are using to connect does not have rights to write to the indicated object.

Please double check the rights for the object per user you are authenticating with.

Regards,

Anastasia

Anastasia Botezat,

Hm, I'm not inserting into any objects here, the service just returns constant values (for now). I'm also authenticating with Supervisor account.

Carlos,

Please check the CSRF header in your request. Probably, you don't pass CSRF cookie and therefore get the error - https://academy.bpmonline.com/documents/technic-sdk/7-12/protection-csrf-attacks-during-integration-bpmonline

If this won't help. please contact our support at support@bpmonline.com, since it's hard to say what's wrong with the request as we don't see the request body and the request headers. Please, use Fiddler as a proxy and send us a full text of the request from Fiddler. This way we will be able to find the cause of issue.

Regards,

Anastasia

Carlos Zaldivar Batista,

How are you calling the configuration service? Is it from within a client schema or from externally using code or something like postman? 

Ryan 

Ryan Farley,

Postman. And before making request to UsrCustomService I first make a request to /ServiceModel/AuthService.svc/Login to obtain authentication cookies.

Carlos Zaldivar Batista,

Are you also copying the contents of the BPMCSRF cookie on the call to AuthService.svc/Login to the CSRF header for the request to the config service? 

This article in the academy outlines the steps for making this call via Postman https://academy.bpmonline.com/documents/technic-sdk/7-13/how-call-confi…

Ryan Farley,

Nope, that's what I was missing. Thanks!

Show all comments

Hi,

When I am trying to send request from BPM (http://localhost:82) to external web app (https://localhost:58733) via 'call web service' system action I am getting an error:

"system.net.webexception could not establish secure channel for ssl/tls ---> system.security.authentication.authenticationexception the remote certificate is invalid"

What I am doing wrong? 'Call Web Service' system action should work with SSL/TLS without any problem?

Best regards,

Tom

 

Like 0

Like

2 comments

I've used Call Web Service with SSL without issue. That error is a general .NET error that usually relates to issues with the certificate and likely means one of the following is true:

  • The certificate doesn't match the URL.
  • The certificate is self-signed and not added as a trusted certificate.
  • The certificate is expired.
  • The certificate is signed by a root certificate that's not installed on your machine.

If the cert is ok, and since this is a local install, you can try going to the external URL in IE (on the server where Bpm'online is installed), click the lock icon then "View Certificates", then click the button to "Install Certificate" (be sure you select to install on "Local Machine" and not "Current User"

Tom,

Please use this article to troubleshoot the issue https://blogs.msdn.microsoft.com/friis/2017/10/10/troubleshooting-tls-s… and also Ryan is right. The reason is probably in certificate so that's why you need to check it firstly.

Best regards,

Oscar

Show all comments

Hi,

I've configured Azure AD to my BPM. Other external application (web app) uses same Azure AD. I am trying to figure it out, how to do this:

1) Logged (via Azure AD) user on external web app, clicks button which will send request to BPM (to execute some process)

2) BPM should receive request and somehow assign executing process to currently logged user on external web app

Do you know the way to do this? Maybe I should do something like this:

1) Create technical user on BPM

2) Use this technical user credentials to login via BPM AuthService 

3) Send request to BPM (one of sent parameters will be username or email of currently logged user on web app)

4) BPM can somehow assign this username/email to executed process (how to do this?)

Maybe there is some better way to make it work? I saw that on BPM 7.13 there is some OAuth 2.0 integration -> https://academy.bpmonline.com/documents/technic-bpms/7-13/setting-oauth-20-application

Best regards,

Tomasz

Like 0

Like

1 comments

Hello Tomasz,

The idea is to authorize your external web app to bpmonline using user`s credentials. More about authentication by the link: 

https://academy.bpmonline.com/documents/technic-sdk/7-13/choosing-metho…

Afterwards, business processes will run under this user. Other way to run process under certain user are not available due to security reasons.



One more way to implement this is to log in as technical user e.g. Supervisor and include information about target user in request, After that it`s up to you how to process it in business process.

Regards,

Alex

Show all comments

Hello community



I am working with a business process using the process element [Call Web Service].

The web service configuration and the call are working correctly.

The JSON response is similar to:

{

"$ totalResults": 2,

"$ startIndex": 1,

"$ itemsPerPage": 100,

"$ resources": [

     {

      "$ clave": "t6UJ9A000001",

      "$ Static_state": 200,

      "$ etag": "Yi4EmiUg3xw =",

       "Account": {

             "$ clave": "A6UJ9A0001RU",

             "$ uuid": "00000000-0000-0000-0000-000000000000",

           }

      },

      {

      "$ clave": "t6UJ9A00000B",

      "$ Static_state": 200,

"$ etag": "wMpPUtrfgdA =",

"Account": {

"$ clave": "A6UJ9A0001RX",

"$ uuid": "00000000-0000-0000-0000-000000000000",

}

}

]

}



My goal is to iterate the JSON and finally create tickets in BPM with the source information.

Using a pre-configured page I was able to determine that the parameter where the information is returned is [#WS Step.Response body #]

How can I take this value in a Script Task and process the JSON? or what is the correct procedure to do this?

Previously I should be able to take the value of the parameter [#WS Setp.Success #] to determine if the execution was successful

Thank you!

Good weekend

Like 0

Like

1 comments

get/set a parameter value in a business process script task

var parameter1 = Get<Guid>("Parameter1");

Set("Parameter2", parameter1.ToString());

var parameter2 = Get<string>("Parameter2");

get object of type UserConnection

var userConnection = Get<UserConnection>("UserConnection");

Show all comments

Hi community!

How are you?

I have a web service configured which returns an object collection among others parameters

Through a business process, I want to process the response of said web service.

For this, I have configured a parameter in the process..







To which, I assign the collection result of the WS as follows:

 


 

Then, in the script, I try to read the collection parameter in a variable..



The process compiles successfully, but when executing it, I get the following error

I tried several alternatives, like



var entities = Get>("Tickets");



or another data type but I keep getting the same error

Any idea or example to process a collection of a web service?

 

(My BPM version is 7.13)

I attached the images to be seen more clearly

Thanks you!



King Regards

 

Ezequiel

Like 0

Like

9 comments

Dear Ezequiel,

Please see the step-by-step instruction on how to correctly retrieve and work with web service collection result in business process Script Task. 



1. To start with, here are my test web service integration settings:

Image.png



Image.png





2. In the business process we will be retrieving needed data directly from the Web Service element. 

The main idea here is to address the results collection via "_Out" suffix. Please pay attention, that we apply suffix to the method's parameter and each variable taken from the collection.









Image.png

 Regards,

Anastasia

AAlonso.29,

Hello.

Please find all of the images via the links below:

https://prnt.sc/m5x10n

https://prnt.sc/m5x0wj

https://prnt.sc/m5x2b5

https://prnt.sc/m5x2me

Best regards,

Matt

Hello Matt

I configured exactly the web service and the business process as in you screenshots but the following statement (My custom prefix is Rv instead of Usr)

var entities = Get<ICompositeObjectList<ICompositeObject>>("WebService1.RvArray_Out");

returns a null variable (entities is null).

The web service response is OK (I tried to show it on a page).

I also tried using this syntax:

var entities = Get<EntityCollection>("WebService1.RvArray_Out");

but the entities variable is still null.

Can you tell me what's wrong with my code?

Thank you very much

 

Massimiliano Mazzacurati,

It seems that webservice simply is not returning the desired array. To confident about this, you may create some test queries to the webservice in postman or fiddler (utilities for web development).  



However, you always can call the webservice in script task via c# code and then process the response from the webservice as you wish.

https://stackoverflow.com/questions/4015324/how-to-make-http-post-web-request



Best regards,

Alex

Hi,

I have a web service from which i fetching data like name, mobile number, email address. Response that is returned is an array. Now want to fetch email address and sent email to all the customers. I have attached the process diagram and task script :

Below is the script for fetching data from web service response: where can see console logs in creatio like values of name and email that have printed in the console.Writeline.

 

UsrParameter is the code of the response parameters. 

When i am sending simple response parameters like name and email script works without any error but when i send array as response i am getting error.

 

var entities = Get<ICompositeObjectList<ICompositeObject>>("WebService1.UsrParameter_Out");

foreach(var entity in entities){

    

     string name="";

     string email="";

     var isnameexist = entity.TryGetValue<string>("UsrName_Out", out name);

      throw new Exception(name);

    

     var isemailexist = entity.TryGetValue<string>("UsrEmail_Out", out email);

    throw new Exception(email);

    

     Console.WriteLine("name "+name);

      Console.WriteLine("email "+email);

     Console.WriteLine("isnameexist "+isnameexist);

      Console.WriteLine("isemailexist "+isemailexist);

    

}

return true;

 

Please help me solve this issue. I am new to creatio. I am struggling with script task element.

 

Thanks 

Nitin

Nitin,

 

Hello,

 

Try composing your approach with the one developed in the "Prepare Recipient Emails" script-task of the base "Send email to case group" business process:

The idea here is to form a list of recipients from a collection of the ESQ request result. You need to use your collection and develop a logic similar to the one developed in the script task.

 

Best regards,

Oscar

Oscar Dylan,

 

Thank you Oscar for reply 

Massimiliano Mazzacurati,

 

When we are fetching responses  from a web service,What is this "WebService1" in the double quotes? From where i can map this value?

Nitin,



here in advanced mode 

you can see the code for webservice and its parameters on 2nd tab

Show all comments