对于移动和 silverlight 前端,我应该如何在 IIS 上托管 WCF RIA DataDomainService?
我创建了一个 RIA DataDomainService,并将其暴露给我的 silverlight 项目。 WCF RIA 服务是 ASP.NET Web 应用程序的一部分。我们在 DataDomainService 的实现上做了很多工作。
Silverlight项目可以检索网站返回的序列化数据。所以一切正常。
现在,客户想使用手机前端。我们想要从手机调用相同的 RIA DataDomainService,为此我们需要将 RIA 服务托管到 Web 服务器或 Windows 服务等。
我无法理解如何在 IIS 上托管 RIA DataDomainService?如果可以请您指导一下吗?我是否应该将 RIA 服务取出并放入 WCF 项目中并将其引用到我的 asp.net 项目中?
请指导
问候
I have created a RIA DataDomainService which I exposed to my silverlight project. The WCF RIA service is part of the ASP.NET web application. We've done a lot of work on the implementation of the DataDomainService.
Silverlight project can retrieve the serialized data that the website returns. 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.
I am unable to understand how to host a RIA DataDomainService on IIS? 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?
Please guide
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果将代码移至 RIA 服务库项目中,它将创建一个 Web 服务库项目和一个客户端库项目,这两个项目都通过 RIA 服务的魔力捆绑在一起。您的网站只需链接到 Web 库即可使用该 Web 库,并且匹配的客户端库将链接到您的 Silverlight 应用程序。
以上通常是组织 RIA 服务的更简洁的方法,但并不是这个问题的真正一部分。
至于使用 WCF 中的 RIA 服务...RIA 服务是 WCF 服务(只是在调用之上有更多的管道)。话虽这么说,您可能只是想使用标准 WCF 服务(共享来自 RIA 服务的代码/数据)公开一个更简单的 API,因为您的目标平台没有任何 RIA 服务客户端代码(据推测,除非是针对 WP7)。
我建议为您的 EF 模型建立一个单独的库,并在您的 RIA 服务项目和单独的 WCF 服务项目中使用它们。由于您的目标平台缺少 RIA 客户端,它们不会那么相似。
在您的网站中托管 WCF 只需将其链接即可,就像 RIA 服务一样。
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. 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.
The above is generally a neater way to organise your RIA services, but not really part of this problem.
As for using the RIA services from WCF... RIA services are WCF services (just with more plumbing on top of the calls). 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).
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. They will not be that similar due to the lack of a RIA client for your target platform.
Hosting the WCF in your website is then just simply linking it in, just like the RIA services.