0

I have written a windows forms (.NET C#) application that encodes video and is essentially a GUI for ffmpeg. The requirement has changed, and we now want to move the UI to a web page and have the encoding done as a windows service.

The following requirements also apply:

  • Two-way communication between browser's web page and service (i.e. start encoding using web interface and have service notify progress back to web page)
  • Service should be ported to Mac OS X too
  • UI should be a standard webpage (should consist of HTML/CSS/JavaScript/Flash etc...)

I was thinking of WCF for the windows service, but I have zero WCF experience. Will WCF provide a good basis for 2 way communication between the web page and the service?

Also, I need to think about porting the service to Mac OS X, and I noticed that WCF is only partially implemented in Mono (see http://www.mono-project.com/WCF_Development). Will this be an issue? Does anyone have any experience with WCF development in Mono?

What would be the best route to meeting the requirements above? I would love to hear any suggestions...

EDIT I should clarify - this is not a web application, it will run entirely on client side.

Service should run client side and interact with a webpage inside a browser (which is also client side).

  • Take a look at [this](http://stackoverflow.com/a/10017974/932418) It may help. – L.B Jul 22 '12 at 16:59
  • Browser does not directly connect to a WCF service. Browser is HTML (or a variant) and typically port 80. WFC is SOAP and an endpoint. – paparazzo Jul 22 '12 at 17:19
  • @L.B This helps for web page to service communication. How should I go about dispatching messages from the service and having the web page intercept them ? – tomerlahav Jul 22 '12 at 17:20
  • HTTP protocol is based on request/response. Maybe what you are after is [WebSocket](http://en.wikipedia.org/wiki/WebSocket), but – L.B Jul 22 '12 at 17:55
  • @L.B WebSocket seems to be exactly what I was looking for, thanks! Why the but ? – tomerlahav Jul 23 '12 at 08:49
  • @user1544084 no meaning. left while editing the comment :) – L.B Jul 23 '12 at 09:00

1 Answers1

0

If you want a UI in HTML – which is what a "UI to a web page" would mean to most – then WCF is the wrong approach. WCF is for creating highly interoperable (WS-* standards) clients and/or servers; not for web pages.

Better looking at ASP.NET MVC. This is a very different model to WinForms,1 but allows easy moving from from rendering a UI into HTML to generating XML or JSON for a Web API (behind AJAX from a Web UI or a native client).

As I understand it ASP.NET MVC is substantially supported on Mono; and this should become easier with much of ASP.NET being open source now.

See also this answer from yesterday.


1 WinForms would be less of a move, but it would then be harder to do the API side without another technology shift (albeit ASP.NET WebForms and MVC can be easily mixed in one Web App).

Community
  • 1
  • 1
Richard
  • 106,783
  • 21
  • 203
  • 265