wcf and session asmx rewrite with Silverlight

谁都会走 提交于 2021-02-10 16:18:01

问题


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

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

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

How can this be accomplished.


回答1:


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.

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.

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.



来源:https://stackoverflow.com/questions/5654133/wcf-and-session-asmx-rewrite-with-silverlight

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!