简体   繁体   English

如何为移动和Silverlight前端在IIS上托管WCF RIA DataDomainService?

[英]How should I Host my WCF RIA DataDomainService On IIS for a mobile and silverlight front end?

I have created a RIA DataDomainService which I exposed to my silverlight project. 我创建了一个RIA DataDomainService,并向我的silverlight项目公开了它。 The WCF RIA service is part of the ASP.NET web application. WCF RIA服务是ASP.NET Web应用程序的一部分。 We've done a lot of work on the implementation of the DataDomainService. 我们已经完成了DataDomainService的实现工作。

Silverlight project can retrieve the serialized data that the website returns. Silverlight项目可以检索网站返回的序列化数据。 So everything works correctly. 因此,一切正常。

Now, the client wants to use mobile phone front end. 现在,客户希望使用手机前端。 We want to call the same RIA DataDomainService from the mobile phone and for that we need to host the RIA service to a webserver or windows service etc. 我们想要从手机调用相同的RIA DataDomainService,为此,我们需要将RIA服务托管到Web服务器或Windows服务等。

I am unable to understand how to host a RIA DataDomainService on IIS? 我无法理解如何在IIS上托管RIA DataDomainService? Can you please guide if it is possible? 能否请您指导? Shall I take the RIA service out and put it in a WCF project and reference it into my asp.net project? 我应该将RIA服务取出并放入WCF项目中,然后将其引用到我的asp.net项目中吗?

Please guide 请指导

Regards 问候

If you move your code into a RIA services library project, it will create a web-service library project and a client library project, both tied together by the magic of RIA services. 如果将代码移到RIA服务库项目中,它将创建一个Web服务库项目和一个客户端库项目,两者均由RIA服务的魔力捆绑在一起。 The web library can be used by your website by simply linking to it and the matching client library gets linked to your Silverlight Application. 您只需将网站库链接到网站即可使用该网络库,然后将匹配的客户端库链接到您的Silverlight应用程序。

The above is generally a neater way to organise your RIA services, but not really part of this problem. 上面通常是组织RIA服务的一种更整洁的方式,但实际上并不是这个问题的一部分。

As for using the RIA services from WCF... RIA services are WCF services (just with more plumbing on top of the calls). 至于使用WCF的RIA服务... RIA服务 WCF服务(只是在调用之上有更多管道)。 That being said you probably do just want to expose a simpler API using a standard WCF service (sharing code/data from your RIA service) as you do not have any RIA services client code for your target platform (presumably, unless it is for WP7). 话虽这么说, 可能只是想使用标准的WCF服务(共享代码/从你的RIA服务数据),露出一个简单的API,你没有任何RIA服务客户端代码为你的目标平台(推测,除非它是WP7 )。

I would suggest a separate library for your EF models and use them in both your RIA services project and a separate WCF service project. 我建议为您的EF模型提供一个单独的库,并在RIA服务项目和单独的WCF服务项目中使用它们。 They will not be that similar due to the lack of a RIA client for your target platform. 由于目标平台缺少RIA客户端,因此它们不会如此相似。

Hosting the WCF in your website is then just simply linking it in, just like the RIA services. 就像RIA服务一样,将WCF托管在您的网站中只是将其链接进来。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM