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).
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).
Related
I have a WPF application that needs to send and fetch data to and from a web application. Web application is built using ruby on rails.
What's confusing me at the moment is does the WPF application need to have a web/wcf service on it's own to talk to the rails web application web service. If not how can i fetch and send data to and from the rails web application web service.
Please note that I have done some digging around google and here but am still confused since most of talk of creating a asp.net application first. A step by step best guess scenario/example would really be helpful.
A while ago I created an ASP.NET MVC Web Application for android devices. The application also used jQuery mobile to set up navigation etc.
At the moment, the application is simply being hosted and the androids webview accesses it that way.
The application works as expected, but I was wondering, is it possible to store the MVC web-app on the phone/integrate it into the apk?
I would like to be able to have it run the web-pages while the device is offline. I know it is possible to run simple HTML in the webview but I haven't been able to find anything about something like an ASP.NET MVC web-app. Is this done using phonegap?
Thanks.
I don't think you can do it directly with PhoneGap, from the PhoneGap FAQ
Q: Can you use PHP/ASP/JSF/Java/.NET with PhoneGap?
A: A PhoneGap application may only use HTML, CSS, and JavaScript.
However, you can make use of network protocols (XmlHTTPRequest, Web Sockets,
etc) to easily communicate with backend services written in any language.
This allows your PhoneGap app to remotely access existing business processes
while the device is connected to the Internet.
So if you are going the PhoneGap route, you'll have to write it in HTML/CSS/JavaScript. However if you more comfortable in .NET and C# then there is always Xamarin Android which has a free starter version that you can try out. Do realize though that if you go that route it will be a mobile app and not a wrapped ASP.NET app.
If I understand correctly I think what you want to do is serve your data via a web service (MVC4 web api is pretty simple to setup). Then you'd consume that data with your android app and you could more easily cache that data for offline use.
I'm just starting a project where I would like to use Kendo UI (based on jquery) with C#. A few weeks ago I was successful in handling requests using Web Services (asmx), was pleased with the results and performance, and was able to create forms quickly.
Since this is a new project, I thought I could look into different concepts such as MVC and WebApi. I found MVC to be the most complicaded so I went for WebApi and started playing with controllers and requests. So far what I'm finding (don't judge me, I'm new to these new concepts), is that Web Service seems to be simpler and more flexible.
So I guess what I'm looking for is... what are the main advantages of using MVC vs WebApi and even vs Web Services. Are there any downsides to Web Services? Would it be a bad practice to have my data layer controlled by Entity Framework, all models defined, and my requests handled by Web Services?
Any clarifications are welcome. Thank you.
In a broader sense, Web API is used to create Web Services ! It uses HTTP as its standard for creating services (instead of SOAP like in asmx) as its more open and any type of client like a mobile app, desktop app, web app etc will understand HTTP protocol. Another advantage is that u can easily use JavaScript/jQuery to communicate with your Web API. With SOAP web services, its a nightmare!
Kendo UI and Web API is a great combination. We have recently created a mobile iPad app using this combination and it worked like a charm. We also used Entity Framework with oracle as back end DB and it never gave any issues.
Webservices are nice if you have the need for it. A need as in needing that logic/data in more than one different type of application (such as web, and a mobile app, and a desktop app). (Or if you want to sell the service you're providing)
Using a webservice for ONLY a website which you don't except to expand to other things is complete overkill.
Furthermore, the MVC framework and the Web Api framework are pretty similar except web api is used exclusively for webservices. Coding in both of them will be the difference between white bread and wheat bread.
I have 2 web forms applications written in c# asp.net. This is the kind of thing I need:
A user clicks a button in web app 1
Web app 1 needs to send some parameters to web app 2 and get a response
Web app 1 uses the response from web app 2 to finish processing the post-back
User is happy
So I guess I need to incorporate some kind of web service thing into my web applications? Please point me in the right direction.
Update:
I've done some more research and found that WCF seems to be a goer. I have used WCF once before (stumbled through it) but how do I use WCF inside a web application - or do I need to create another application just for WCF?
Inter-process communication is a pretty large topic and there are many ways to do it.
Some tings to consider are
Synchronous vs Asynchronous - What should be the behavior if the user clicks the button twice in quick succession?
What should happen if user clicks the button but the web app2 is down for a few minutes?
Authorization and security
Denial Of Service style attacks
For something of this nature I would be inclined to use something like a message-queue maybe managed by something like nservicebus it would be a very simple, yet robust solution. WCF is another option and so is MVC 4.0 web services.
I have to pass information from a desktop application to Web application and vice versa.
What are the best practices that are regularly used?
Currrently I'm using Asp.Net and a Winforms.
To pass data to Web Site im creating a (POST) WebRequest and posting an xml to the site.
To pass data to Application im using .Net Remoting from Asp.net
(I'm using Winforms is an adminstration and monitoring application.)
Edit: Lets treat it as a generic web app and winforms.
Also currently both Web app and Winforms are on the same machine.(but can change).
Web Services or Windows Communication Foundation (WCF) would be your best bets for remote interoperability.
On your website, expose some service end points and consume them from your desktop app. Then send messages as you require.
I'd look hard at the design of the system and consider whether it's necessary to use a Winforms application at all for monitoring and administration. No, really: creating rich Web sites is quite straightforward (if necessary, with technologies like AJAX) and the architecture of the resulting application will be much, much simpler.
And, of course, deployment is then really simple.
I am not sure if there is a best practice for what you are trying to accomplish. There might be some security concerns you have to think about when allowing posts to your web application however. It would be very easy for a potential attacker to manipulate the post data and send it to your web application. You should consider using web services or Windows Communication Foundation.
Register a custom handler like how Real player registers rstp:// or for that matter web browsers register http://