wcf 和 session asmx 用 Silverlight 重写 [英] wcf and session asmx rewrite with Silverlight

查看:30
本文介绍了wcf 和 session asmx 用 Silverlight 重写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 Session 的网络服务.我想将其重写为可以在 IIS 之外托管的 WCF.

I have a web service that uses Session. I want to rewrite it as an WCF that can be hosted outside IIS.

使用 WCF 替换会话的最佳方法是什么,这样在重写时不会将我绑定到 IIS?

What is the best way to replace session using WCF that wont tie me to IIS in my rewrite?

起初我很高兴因为 wsHttpBinding.然后我读到 Silverlight 不能使用它,我很伤心.

At first I was happy because of wsHttpBinding. Then I read that Silverlight can not use this and I was sad.

这是如何实现的.

推荐答案

糟糕.我认为 Silverlight 不支持任何基于 http 的绑定,这将允许您创建有状态的 WCF 服务.您可以使用 Silverlight 4 支持的 net.tcp 绑定来制作有状态的 WCF 服务.

Badly. I think Silverlight doesn't support any http based binding which would allow you creating stateful WCF service. You can make stateful WCF service with net.tcp binding which is supported in Silverlight 4.

无论如何,WCF 和会话与 asmx 和 http 会话的工作方式不同.您将不得不处理许多额外的复杂性,并且您的会话存储将是一个服务实例本身,或者您将不得不编写自定义 InstanceContext 扩展.

Anyway WCF and session doesn't work in the same way as asmx and http session. You will have to handle a lot of additional complexities and your session storage will be either a service instance itself or you will have to write custom InstanceContext extension.

您可以将 WCF 与旧的 http 会话(如 asmx)一起使用,但我不确定这是否适用于 IIS.将 WCF 与 http 会话一起使用意味着将 WCF 降级回 asmx.

You can use WCF with old http session (like in asmx) but I'm not sure if this works outside of IIS. Using WCF with http session means degrading WCF back to asmx.

这篇关于wcf 和 session asmx 用 Silverlight 重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆