I'm developing a silverlight app using WCF Ria service. My WCF Ria service is hosted on serverA and the silverlight app is hosted on serverB. First, i create a WCF service and in my silverlight app, i added the referece to the WCF service. I added the crossdomain files and able to access the functions in the service. Good.
Back to my WCF service in VS 2010, i added the ADO.NET Entity Data Model and the Domain Service. VS creates a few files refencing the tables i selected. I compiled the service and update the new files to serverA.
Back to my silverlight app in VS. I updated the service reference. Good, no error.
Now, how do i use the Ria doman service? I've seen a few samples where they add the ADO.NET Entity Data and the Domain Service within the Silverlight app. Do i misunderstand the Ria service? Or do i have to call the WCF function then within that function to manipulate the DomainServcie object?
Domain Context – This is the client side counterpart to the domain service. It is generated code on the client side that gives you easy access to the functionality that resides on the server side.
DomainDataSource – This is a data source object that can be used to execute queries and submit changes to the server side. It gets associated with the domain context and makes calls through that domain context on your behalf to query and update entities
If you want to call your RIA domain service, you need to create an instance of the domain context class that will be used to call the domain service. For more about this, you can refer to this article.
"It is generated code on the client side that gives you easy access to the functionality that resides on the server side." ... in my case, it will not be on the client, because I added the ADO.NET Data Service and Domain service in the WCF project
which is hosted on serverA. And the Silverlight is hosted on serverB.
All of the WCF Ria samples I have seen so far is that the ADO.NET Data Service and Domain Service are added to the Silverlight project.
WishStar99
Contributor
2842 Points
865 Posts
Question regarding WCF and Ria service.
Jan 10, 2012 05:10 PM|LINK
Peter pi - M...
Star
12871 Points
1786 Posts
Re: Question regarding WCF and Ria service.
Jan 12, 2012 01:34 AM|LINK
Hi,
There are twi key concepts in WCF RIA Services.
Domain Context – This is the client side counterpart to the domain service. It is generated code on the client side that gives you easy access to the functionality that resides on the server side.
DomainDataSource – This is a data source object that can be used to execute queries and submit changes to the server side. It gets associated with the domain context and makes calls through that domain context on your behalf to query and update entities
If you want to call your RIA domain service, you need to create an instance of the domain context class that will be used to call the domain service. For more about this, you can refer to this article.
http://www.silverlight.net/learn/advanced-techniques/wcf-ria-services/using-wcf-ria-services#Exercise3
Regards,
Peter
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
WishStar99
Contributor
2842 Points
865 Posts
Re: Question regarding WCF and Ria service.
Jan 12, 2012 05:27 PM|LINK
Peter,
thanks for the reply.
"It is generated code on the client side that gives you easy access to the functionality that resides on the server side." ... in my case, it will not be on the client, because I added the ADO.NET Data Service and Domain service in the WCF project which is hosted on serverA. And the Silverlight is hosted on serverB.
All of the WCF Ria samples I have seen so far is that the ADO.NET Data Service and Domain Service are added to the Silverlight project.
WishStar99
Contributor
2842 Points
865 Posts
Re: Question regarding WCF and Ria service.
Jan 12, 2012 07:11 PM|LINK
Okay, I found a Linq to SQL sample. That works too =) Thanks.
kadkhoda
Member
2 Points
1 Post
Re: Question regarding WCF and Ria service.
May 01, 2012 03:11 PM|LINK
Hi, I have the same problem but still havn't found the solution, would you please give the details of the solution?
Thanks in advance