Integrating a C# app with an existing website
I have some backend functionality which need to be written in C# (for political, not technical reasons).
The C# 'module' is to provide functionality for a website, which is written in PHP.
The hosting environment for the completed solution will be as follows:
- Operating system: Linux
- Web server: Apache
- Backend db: mySQl and/or PostgreSQL.
The C# 'module' will be business logic only, (i.e. no GUI).
This is my proposed solution so far, I would like to know if I am going down the correct path and/or if my proposed solution may be improved:
I am guessing that I will have to write and deploy the C# module as a stand alone executable
Add a RESTful API to the C# executable or communicate directly to the C# executable using TCP/IP from the web app. I prefer the RESTful API since it is higher level, but there may be performance considerations - I'd like to hear of pros and cons on choosing one over the other - to help me to decide whether to use a RESTful API or TCP/IP to communicate with the web app.
What is the "best" way to bind C++ to C# (I will be making use of C++ libraries in my C# application).
开发者_如何学CI will have mono installed on the server, to host the C# application.
Since I don't often use C#, I wonder if a "C# expert" can tell me if I am going about this the right way, and/or if this approach can be improved?
Yes. My guess is you would want it to be an executable communicating with WCF or a Web Service hosted with IIS communicating with WCF.
Depending on your requirements, I would investigate the HTTP Long Polling technique.
C# can use PInvoke through DllImport to use any available C++ library calls.
精彩评论