Yes you can definitely host a silverlight application in an mvc4 web site and use WebApi to provide the services needed for the application. Silverlight allows you to interact with web api by providing json serialization utilities.
In addition you might want to consier the new single page application template that allows you to build client side apps completely in javascript/html/css and interact with web api. It's a much more light way solution than silverlight, but there is a learing
curve. Here's a great video on single page applications http://channel9.msdn.com/Events/TechDays/TechDays-2012-Belgium/199
It's no different than securing a regular web application. You would use ssl, authorization/authentication. If you need a more robust and secure service solution, then instead of a RESTful service you might want to consider RIA services or WCF.
Actually RIA Services are usually used in RAD, where you want to create a solution quickly, without too many custom code. It works best for Silverlight clients, as in most cases it is not needed to write a single line of code to create a fully functional
CRUD style application. But this doesn’t mean RIA is more robust and secure than REST. To access RIA services from a JavaScript client, please expose a JSON/OData endpoint. An OData service is a REST service.
You can definitely use ASP.NET Web API for your scenario. Using SSL in ASP.NET Web API is no different from normal ASP.NET application. You can configure the web server (such as IIS) to support SSL. If authentication/authorization is required, you can also
use existing security mechanisms in ASP.NET, such as membership/role. There’re also a bunch of other authentication mechanisms. Please refer to
http://blogs.msdn.com/b/astoriateam/archive/tags/authentication/ for a series of blog articles about REST security. While they focus on OData, the same solutions can be used in other
REST services.
Hope this helpful
Regards
Young Yang
Please mark the replies as answers if they help or unmark if not.
Feedback to us
srinivas_nzd
Member
210 Points
45 Posts
SL Client, Html client for an MVC4 web appliction
Apr 17, 2012 03:32 PM|LINK
Hi,
After a long time I need to develop a web based solution. (I did some web apps using ASP.NET 1.1 and 2.0 then, now a days I'm with Winforms and WPF)
Will it possible to use same MVC4 web application to create a sliverlight client and HTML, jquery client?
To me it looks like developing Web Api using MVC4 and then consuming it in silverlight and jquery clients is the way to go.
What options I have?
Based on my background please suggest some "Get started" links.
Thanks,
Srinivas
India
CodeHobo
All-Star
18647 Points
2647 Posts
Re: SL Client, Html client for an MVC4 web appliction
Apr 17, 2012 03:39 PM|LINK
Yes you can definitely host a silverlight application in an mvc4 web site and use WebApi to provide the services needed for the application. Silverlight allows you to interact with web api by providing json serialization utilities.
In addition you might want to consier the new single page application template that allows you to build client side apps completely in javascript/html/css and interact with web api. It's a much more light way solution than silverlight, but there is a learing curve. Here's a great video on single page applications
http://channel9.msdn.com/Events/TechDays/TechDays-2012-Belgium/199
Also, take a look at the following:
http://10rem.net/blog/2012/02/26/rest-with-silverlight-5-aspnet-web-api-and-mvc-4-beta
You can learn a lot about WebAPI here
http://www.asp.net/web-api
Here's a great video series on Web Api
http://weblogs.asp.net/jgalloway/archive/2012/03/16/asp-net-web-api-screencast-series-with-downloadable-sample-code-part-1.aspx
Blog | Twitter : @Hattan
srinivas_nzd
Member
210 Points
45 Posts
Re: SL Client, Html client for an MVC4 web appliction
Apr 17, 2012 03:58 PM|LINK
Thanks for the quick reply.
Can you provide me some information/links about, how to secure the transportation(ssl).
/Srinivas
India
CodeHobo
All-Star
18647 Points
2647 Posts
Re: SL Client, Html client for an MVC4 web appliction
Apr 17, 2012 08:04 PM|LINK
It's no different than securing a regular web application. You would use ssl, authorization/authentication. If you need a more robust and secure service solution, then instead of a RESTful service you might want to consider RIA services or WCF.
Blog | Twitter : @Hattan
srinivas_nzd
Member
210 Points
45 Posts
Re: SL Client, Html client for an MVC4 web appliction
Apr 18, 2012 07:50 AM|LINK
Hi,
1. What makes RIA and WCF services more robust and secure?
2. Why REST services are not robust even if they support ssl, authorization/authentication.
3. With my initial idea, I thought I just need to project in VS 1. For ASP.NET web app 2.SL Client
4. If I take WCF appraoch I need 4 projects 1.WCF 2.SL Client 3.SL Client Web (to host sl client) 4.ASP.NET web app(Razor) for html client.
I feel the WCF approah needs more effort and less efficient as it need SOAP stuff on the communication stack.
/Srinivas
India
Young Yang -...
All-Star
21343 Points
1818 Posts
Microsoft
Re: SL Client, Html client for an MVC4 web appliction
Apr 24, 2012 06:18 AM|LINK
Hi
Actually RIA Services are usually used in RAD, where you want to create a solution quickly, without too many custom code. It works best for Silverlight clients, as in most cases it is not needed to write a single line of code to create a fully functional CRUD style application. But this doesn’t mean RIA is more robust and secure than REST. To access RIA services from a JavaScript client, please expose a JSON/OData endpoint. An OData service is a REST service.
You can definitely use ASP.NET Web API for your scenario. Using SSL in ASP.NET Web API is no different from normal ASP.NET application. You can configure the web server (such as IIS) to support SSL. If authentication/authorization is required, you can also use existing security mechanisms in ASP.NET, such as membership/role. There’re also a bunch of other authentication mechanisms. Please refer to http://blogs.msdn.com/b/astoriateam/archive/tags/authentication/ for a series of blog articles about REST security. While they focus on OData, the same solutions can be used in other REST services.
Hope this helpful
Regards
Young Yang
Feedback to us
Develop and promote your apps in Windows Store