Reputation: 82
I'm a .NET back-end developer, working on a project which includes a website platform.
One of the requirements is to have payment process. For this process I must have some kind of a calculator service.
To calculate the payment for each of the clients depending on some criteria stored in the database.
The technologies I'm using:
This calculator service should be available for all of the parts written above. Which means when a client is on the website and asks for a payment, WebApi has access to this payment process, when the back-end logic need the calculation the same happen and so on..
I'm not sure if I took the best approach however I created a simple WCF service using HTTP binding for this solution.
However I have some doubts about it since WCF is not always reliable, if it is down I need to do some kind of a check to see if the process is alive.
So I have 2 questions:
Is the WCF service a correct choice for my approach? Is there any better approach ?
If the WCF Service is the correct choice is there a way to create a keep-alive mechanism in WebAPI?
Upvotes: 0
Views: 44
Reputation: 4024
Based on the information supplied and the answers given in the comments there is no use to use a WebAPI to calculate any data.
From my point you need to add an project that does the calculation process. This includes retrieving data from your database and calculates the data based on the information supplied by your website. This project returns the calculated data to your website.
No need for Webservices, Windows Services or console applications.
For your admin you create a 2nd project that maintains the database and include the same project.
Upvotes: 1