I have a silverlight application and uses wcf ria services. The question is about the options to host the wcf ria services.
In all the articles I read says, the RIA services should be hosted on the same web application where the silverlight app is hosted.
An alternative is , we can use WCF RIA class library, but still this need to be referenced in the silverlight web app where the silverlight is hosted.
I am wondering , for a cleaner implementation , can I host the WCF RIA services in any other web apps?
The default scenario for WCF RIA Services assumes that you will create your business objects to be shared between the server and the client within your web project, and these will be replicated within your Silverlight project.
However, this scenario doesn't create an ideal separate “middle tier” where your business objects are contained within a separate assembly that can then be reused between applications.
This is where the WCF RIA Services Class Library project template comes in. It is possible, however, to move the business logic out of the Web project and into a separate class
library, using the WCF RIA Services Class Library project template. So you can have your entities and metadata classes in a separate project from your server project. But you must add a reference to it in your web project where the silverlight is hosted.
This is a reasonable thing
Related
Looking at an earlier 3.5 based solution, there is an WCF service within the same web project. I thought WCF services generally got their own project.
I usually separate my WCF projects out for maintenance purposes, but they can be within a web project. It is basically the same thing as the old ASMX [WebMethod] process. In fact, any method in a code-behind of a web form can be turned into a web service method by decorating the method accordingly.
What is the difference between developing WCF service by opening a console application project(generally) and a WCF project? By creating a WCF service project, the auto generated files consist of app_data, IService1.cs , Service1.svc and web.config. What is the purpose of those files?
thanks!
a WCF service project is a web project designed to run in IIS.
The web.config file contains the configuration of the web app (and the WCF service configuration -endpoint, behaviors, bindings)
The svc file is the web resource your client will call, it associates an url (service1.svc) with a service contract.
The IService1.cs file contains the service contract interface.
there is a Service.svc.cs file too which contains the service contract implementation.
If you use WCF in a console project, you will have to start WCF yourself (ServiceHost etc...)
If you use WCF in a web application, this logic is handled by the service activation framework in IIS, using the configuration provided by web.config.
IIS activated WCF services are easier to use, but require to be hosted by the web server.
I am developing Silverlight application with Prism 4 and WCF RIA service.
I had searched on google to get sample explaining this, but failed to get any successful output.
I am confuse about how to use RIA service in PRISM Application.
Please suggest any link which provide sample for this.
Help me.
You can use WCF RIA and PRISM 4 to develop a Silverlight application. Each of the technologies is targeted at a different part of your application.
WCF RIA services provides you with the tools to communicate from client to server to persist your data.
PRISM4 is designed to allow you to construct modular well architected Silverlight (and WPF) applications.
I have a large LOB application built using this approach. I use PRISM4 modularity to load modules into my application. The viewmodels in each of the modules connect to WCF RIA domain service contexts to get and modify data.
I'd recommend looking at Nikhilk's Book Club sample application for the RIA side http://www.nikhilk.net/RIA-Services-MIX10-Slides-Code.aspx.
Is it possible to build a SL application with RIA class library without the .web project.
I mean the Business will be hosted on the RIA class library, do I still need the first generated .web for my SL project?
Best regards
You can create them separately - the key bit is the 'WCF RIA Services Link' which you'll set on your Silverlight project once your RIA web app is around for it to use:
http://msdn.microsoft.com/en-us/library/ee707372(VS.91).aspx
We currently have a Silverlight 2.0 application communicating with a set of WCF web services. These services communicate with other WCF services for business logic.
Client DMZ Intranet
Silverlight -> WCF Web Service Gateway -> WCF Biz service -> DB
The WCF web service gateway resides within the DMZ.
We see that Ria services can replace our WCF web Service gateway, but this means that it will be installed in our DMZ and have access to our database... Is this secure?
We also seem to loose our business logic WCF services... I would need to put the business logic within Ria services (as it has connection to the database and holds the domain...).
What is the recommended patter for Ria services? Where does it fit?
What is the approach for companies that already invested in WCF web services? Can they use RIA?
We are looking at this alternative, were we would expose both web services and Ria...
Silverlight -> WCF web service - > WCF biz service -> DB
-> Ria services -> DB
Any comments? I also wonder if anyone is actually using Ria in production....
Your proposal architecture with the silverlight app calling
both WCF Services and Ria services sounds fair to me.
Suppose your DB has an Employee Entity.
I can get this approach up and running, but have some issues
Suppose "the WCF biz service" accesses and modifies Employee.
does it get this data from the database directly?
(if so, is the EntityFramework edmx model shared between "the WCF biz service" and ria?)
does it in turn uses the RIA layer, and thus the EmployeeRiaProxy?
..?
Suppose you want to use the Employee Entity on your "WCF biz service" operation contract
This should not be possible in a pure SOA architecture?
Use a pure DTO data contract style approach with an EmployeeDto?
Should you use the Employee, or the EmployeeRiaProxy?
Using the Employee is not possible because the silverlight app does not know it
(or would cause another EmployeeWCFProxy type being created on the client)
Using the EmployeeRiaProxy is possible, but ties your operation contract to a
Ria proxy (pretty poor design) and assumes the service uses RIA for data access
Or should everything pass through this RIA layer? from which you call "the WCF biz service" in turn then?
Any opinions welcome!
Koen