Integration Kentico with external data base by calling web service

Mateusz Żebrowski asked on April 25, 2015 18:06


I need to integrate external data base with Kentico (v8.1). I can get the data from this data base by calling the web service. So synchronization should be processed as follow:

  1. Call the web service – once a day
  2. Check if there are new records in data base
  3. If there are for each of them create a new document (type of this document is already define)

I know that this integration is provided by Integration Bus module but I don’t know how exactly it should be implemented. The code should be in the connector class but I not sure if I shouldn’t write something else.

First question: If I assume that web service should be call once a day, should it be called in connector class? In other words, before I start to write connector class shouldn’t I first write code that call the web service and based on data returned by it call the ProcessExternalTask(…) method. Or both web service and ProcessExternalTask(…) should be call in connector? If in connector, where should I call them? If I will have the external object in connector class I should implement the PrepareInternalObject(…) method.

Second question: method takes an object as parameter. From where should I take this object. I understand that it is external object. I have already pass it to the ProcessExternalTask(...) method. How can I refer to it?

Third question: method take dataType as parameter. I think in my case the best will be SimpleSnapshot. Am I right?

At the end I should implement GetInternalDocumentParams(…). There five arguments to be passed, three of them are “out parameters” so they don’t have to have value.

Fourth question: What value should id and calssName have? What this method exactly do? Should I use somewhere those out parameters?

If I’m correct this is everything I need to write.

The last question: Is it? :)

Correct Answer

Brenden Kehren answered on April 26, 2015 20:12

For a once per day or more of a scheduled task that you want to happen, I'd simply create a custom scheduled task that calls your web service vs. coding the integration bus. The integration bus will process whenever an action happens. The integration bus is used for more of a real-time sync approach vs. a scheduled data retrieval approach.

2 votesVote for this answer Unmark Correct answer

Recent Answers

Mateusz Żebrowski answered on April 26, 2015 21:40

So you say there is no need to coding integration bus? All I have to do is create custom scheduled task. That task will call the web service and create documents if there will be some new ones, right? Therefore, integration bus is used when the data are pushed from external system, but it shouldn't be used when data are pulled from external system. Am I understand you correctly?

0 votesVote for this answer Mark as a Correct answer

Charles Matvchuk answered on April 27, 2015 03:11

I wouldn't say it shouldn't be used when data is pulled from an external system. Each different scenario may require a different process. In your scenario, use the scheduled task.

1 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on April 27, 2015 03:39

Don't look at it as a push/pull scenario or internal/external data retrieval. Look at it more of how often you need the data and how much error handling you need. The integration bus has a lot of built-in error handling for re-processing tasks when things fail. Whereas with a scheduled task, you'd need to code for that.

For this question, I'd use a scheduled task; simple to implement and code and maintain. I find many cases where a scheduled task will work for both pull and push scenarios. There are some which require more robust integration and frequency so I choose to use the integration bus, but do so after ruling out a scheduled task.

2 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.