Asp.Net wcf vs ftp vs httphandler for file upload - silverlight

In my application i have to upload large files. Its a silverlight application which uploads the file using internet to some server. The application is installed on client machine. I was searching out for options that i can have. Any suggestion on which one would be better between WCF, FTP, Httphandler and why. I am using .Net 4.0 and save the file to Sql using SqlFileStream.

The question really is: what problem are you trying to solve?
WCF is out of question since even if you get the browser to talk to a WCF service, it would have to be sitting on the top ASP.NET and doing what a simple ASP.NET page can.
Browser cannot upload FTP so that is out of question as well.
HttpHandler is an option but does not provide a benefit for uploads so you could use it but you might as well use a simple ASP.NET page.
Your main problems (and their solutions) are:
ASP.NET is configured to accept up to 4 MB so you have to change configuration to allow more.
To get a reliable upload, you need to implement a chunked uploading at client side using Silverlight or Flash but you do not seem to be going that route.
Update
Based on your updates, I would recommend chunked uploading using SilverLight on Client and HttpHandler on the server.

Related

Real-time messages notifications with WPF + WCF

Hey I'm trying to upgrade notifications service that uses task polling to see if there are new messages for a given interval.
My client is a WPF application and WCF in the server side.
I have 2 application servers with windows server 2008 r2 and load balancer between them.
I thought of implementing it with WCF Duplex binding and noticed it will be a problem to manage my users in 2 service instances (since I can subscribe user only to 1 service).
The trigger for sending messages is when data is manipulated by a user and is related to other specific users.
Another important point is that we plan to scrap our wpf application and revise our front end as web project (with angularjs probably..) and our backend from wcf to .net web api.
I read a bit about push techniques and came to this conclusion:
SignalR - the thing is, how will it work with web? (angular.js instead of asp.net)
Wamp - didnt find much about it but it looks promising
Websockets
.NET implementation (requires IIS 8 which means upgrading our servers)
socket.io - simple and great documentation and community. but I'm not familiar with nodejs.
What are your thoughts about how to implement it?
Thanks, Bar

IIS and WPF video streaming

I need someone to point to right direction in both silverlight in WPF video streaming.
I have two projects, one is a Silverlight web page and the other is a WPF project. The goal is, on the WPF application the user is able to upload a video to the server, and the Silverlight web page streams it using a any web protocol (most likely http).
I'm using Expression Encoder SDK to build the code that re-encodes the video files (since the original video files will be very big, over 1gb each), and so far I think I've got it right, but now I need to stream it on the web, and I'm not being able to do so.
The silverlight web page is hosted on a Windows Server 2008 R2 with IIS 7.0.
I've been reading about IIS streaming, but everything I find points that every time the user wants to add a video, it must go to IIS interface and add it manually, and that cannot be the only way, since the user knows nothing about IIS.
If possible I would like some code examples on how to achieve streaming through IIS, and some pointer on what I could do, or am doing wrong...
Thanks
I dont see why user have to manually do it everytime in IIS. From your WPF app, make it store your video in a specific location inside your IIS. Also do a one time configuration in your IIS to deliver the video extension you are uploading, if its mp4 or wmv, give it the MIME type, "application/octet-stream", so when a user requests it, it will be delivered by IIS.
No, configure your silverlight app to read the file from your IIS directory (you must be knowing the filename it got saved in IIS in the first place.)
If you need to have a "streaming" experience, IIS won't be enough, you will have to use a streaming server like windows media server or flash media server.
Hope this helps.

"Calls to the web service will fail..." Once Again

Last year someone reported encountering this problem ("The Silverlight project you are about to debug uses web services. Calls to the web service will fail unless the silverlight project is hosted in and launched from the same web project that contains the web services.") and accepted the answer to "set the web project which hosts the Silverlight application to be your startup project."
I'm seeing the same message, but think the solution might have to be different. I am building in VS 2010 a Silverlight application to access the Google Weather API, with VB as the code-behind. The API will return a XML file with data for the specified city (ex., "http://www.google.com/ig/api?weather=london,england"). The Solution Explorer only shows my VB/Silverlight project ("GetWeather"), and the Project Properties dialog box shows the Startup Object as "GetWeather.App" -- the only choice. I'm trying to use a WebClient object to make the call and an XDocument object to parse the return. But I repeatedly get the above error message, with no other result. What am I doing wrong?
Thank you in advance!
I would add a simple Web project and configure it to host the Silverlight app. You'll need to host the app somewhere anyways, so why not create a stub ASP.NET application in your solution? The easiest way is to create a new Silverlight app solution selecting an ASP.NET web project as the host, and then copying your existing code to that solution. Then you should set the web project as the startup one. This should make debugging a lot easier.
Besides, do remember to configure the client access policy to enable cross-domain calls. Check out this article

Send simple data from wp7 to winforms application

I want to send simple data (geolocation data to be precise) from Windows Phone 7 application to a windows forms application and use it, as I'm a total beginner in this field I don't know which tools to use.
I searched about wcf services and tested this method but there's some issues: the data is sent from the phone application but isn't sent to the winforms application (guess something is missing)
If your know how to do this in a quick way, or have good tutorials I'll be thankful.
EDIT
I found this tutorial, it show how to connect directly wp7 application and desktop application without using sockets neither wcf service, I'm wondering if it is really works if the application isn't in localhost.
the like for the tutorial: wp7 tutorial
I had a similar problem and so I created a REST/JSON WCF service hosted in IIS with AppHarbor to provide the data. There's hundreds of ways to do it (Ruby/Heroku, etc..), but that particular one fits well within the Microsoft stack. I also needed to share route data and I used the WCF service to wrap the BingMaps services so that route computations are cached and shared. Considering that I had already created a local model, moving it out of my phone project into a service took less than a few hours (including the usual config hiccups, and forgetting to add the appharbor user to my bitbucket repo).
Consuming the service from WinForms (or any client) shouldn't be an issue as the service knows nothing about the client implementation.
Here's a tutorial from code project. REST WCF Service with JSON
I think you would need to implement some sort of server side solution which you could upload to on your Windows Phone and download from on your Windows Form application. This could be achieved using a WCF service which was connected to a server side database.
Another option would be to use sockets and communicate directly with your WinForms application. Check this tutorial on how to use basic sockets on WP7.

Sharepoint with silverlight app

I am new to Sharepoint. I wrote a simple RIA MCF silverlight app which runs all the queries right on my server. Now I tried make it available on a Sharepoint testing site. I loaded the xap file but Sharepoint throws me tons of load operation exceptions when it tries to load the app, apparently having problems with the EDM in the app. What do I need to do here? Is the xap the only thing I need to load on the shared documents folder?
Thanks.
Justin,
There are few steps you need to follow to load the Silverlight XAP in sharepoint.
You need to create RIA service as an independently hostable web application (.svc)
Follow the guidelines available here
Once you have the solution ready. Host service on IIS and make sure that it is functioning correctly.
Configure the .svc in the web.config of the hosting web application and access the same in your silverlight application as below
new LoggingContext(new Uri(ConfigurationManager.AppSettings["LoggingServiceUrl"]);
Load the xap on sharepoint site and in the configuration section provide links to .svc services.

Resources