Question

Business process and webservice integration?

how can I write data received

from an external webservice in

the contact table

using a business process?

 

 

Like 0

Like

4 comments

Hello Stefano,

For such purpose, you need to create a script task. In the Script task you need to get the response from your web-service, deserialize it and set the deserialized values as a business process parameters. After that you will be able to modify your Contact object with the business process parameters.

Please, see an example how you can obtain a response from the web-service and deserialize it in the Script task:

string response = Get<string>("WebService1.Response");

var resCollection = System.Web.Helpers.Json.Decode(response);

Please, note that you need to add the System.Web.Helpers library to the External Assemblies of your package in the Configuration.

Hello Tetiana,

Thank you for your response.

The sample above (you can find it at https://academy.bpmonline.com/documents/technic-bpms/7-12/call-web-serv… a business process that uses "Call web service" action but it's not documented how the "Log in to bpm'online" and "Insert contact bpm'online" is done.

Do you know how to make it?

I believe the mentioned article is not about the business-process "Get contacts from third-party database". It is just an example how to work with the 'Call web-service' element. Therefore, it doesn't cover all process elements.

If you need to get the contacts from the external web-service, the algorithm is the next:

- Create a web-service and specify all its methods and response paramaters. You can use this guide as an example - https://academy.bpmonline.com/documents/technic-bpms/7-12/calling-web-s…

- Create a business process with [Call web-service] element

- Create a script task to parse your response data. 

As an alternative, you can specify all your web-service response parameters, following this guide - https://academy.bpmonline.com/documents/technic-bpms/7-12/setting-parsi…

- Than you need to insert the parsed response parameters to the contact table via [Add data] business process element. Please, see the 'Working with web service response' part of the guide (https://academy.bpmonline.com/documents/technic-bpms/7-12/call-web-serv…). In your case, you need to use [Add data] element instead of the [Pre-configured page]

Hi Tetiana

I found the solution.

  • Create a web-service and specify all its methods and response paramaters:  I captured with "fiddler tool" the json request and the json response for Login to Bpm-online and the json request and the json response for Insert a new contact
  •  Create a business process with [Call web-service] element: using quick setup and the json mentioned above I configured the [Call web-service] element
Show all comments