简体   繁体   English

如何在客户端保持与Web服务的会话?

[英]How can I keep the session with the webservice at client?

My clients could invoke the webservice dynamically by reflection. 我的客户可以通过反射动态调用Web服务。 But how to get the cookies about the session with the webservice? 但是,如何获取有关Web服务会话的cookie? I know set the webmethodattribute enablesession is true, but at the client the webservice object which was generated by reflection has not the attribute of cookiecontainer, how to make it to keep the session state? 我知道将webmethodattribute enablesession设置为true,但是在客户端通过反射生成的webservice对象没有cookiecontainer的属性,如何使其保持会话状态?

在Web服务方法上使用EnableSessionAttribute,这将使它们使用(并保持)会话对象,如MSDN此处所述

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

相关问题 如何在Threaded .Net Web服务中启用会话? - How can I enable session in Threaded .Net Webservice? 在WCF中引用另一个Web服务时,我可以与客户端应用程序保持httpBinding吗? - Can I keep httpBinding off from client app when referencing another webservice in WCF? 如何将.Net 2.0 Web服务公开给Silverlight客户端? - How can I expose a .Net 2.0 Webservice to a Silverlight client? 如何在会话中保留Button / TextBox / etc? - How can I keep a Button/TextBox/etc in session? 我如何使用ASP.NET C#中的客户端证书访问Soap Web服务 - How Can i access soap webservice using Client certificates in asp.net c# 如何使用Webservice C#将数据从数据库发送到客户端 - How can I send data from database to client with webservice C# 如何让WebClient(Web服务客户端)自动使用默认代理服务器? - How can I get WebClient (webservice client) to automatically use the default proxy server? 为什么无法将我的对象传递到在Webservice中创建的会话中 - Why can't I pass my Object into session created in Webservice WCF客户端如何使用多部分/相关的java webservice响应? - How can a WCF client consume a multipart/related java webservice reponse? 如何优化SSL会话,以便以后可以重新使用它(如果需要)以提高客户端服务器的性能 - How can I optimize SSL session so I can reuse it later (if needed) to improve Client Server performance
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM