开发者

Calling a web service that uses session state in wcf

开发者 https://www.devze.com 2022-12-13 02:23 出处:网络
I have a web service that calls another web service that uses session state.Now I am rewriting the web service and making it WCF.I am having some confusion on how to call my web service from my wcf se

I have a web service that calls another web service that uses session state. Now I am rewriting the web service and making it WCF. I am having some confusion on how to call my web service from my wcf service.

Here is the code as it exists now:

[WebMethod(EnableSession = true]
public string MyWebServiceCall()
{
   string result;
   MyOtherWebService.MyOtherWebService C = 
                                new MyOtherWebService.MyOtherWebService();
开发者_运维百科   C.CookieContainer = GetCookieContainer();
   result = C.GetResult();
   Session[_codingBookSession] = C.CookieContainer;
   return result;
}


you can find information about working with sessions in WCF in this MSDN article:
http://msdn.microsoft.com/en-us/library/ms733040.aspx

In Windows Communication Foundation (WCF) applications, a session correlates a group of messages into a conversation. WCF sessions are different than the session object available in ASP.NET applications, support different behaviors, and are controlled in different ways. This topic describes the features that sessions enable in WCF applications and how to use them.

0

精彩评论

暂无评论...
验证码 换一张
取 消