[英]Calling a web service that uses session state in wcf
我有一個Web服務,該服務調用另一個使用會話狀態的Web服務。 現在,我正在重寫Web服務並使其成為WCF。 我對如何從wcf服務中調用Web服務感到困惑。
這是現在存在的代碼:
[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;
}
您可以在此MSDN文章中找到有關在WCF中使用會話的信息:
http://msdn.microsoft.com/en-us/library/ms733040.aspx
在Windows Communication Foundation(WCF)應用程序中,會話將一組消息關聯到對話中。 WCF會話不同於ASP.NET應用程序中可用的會話對象 ,支持不同的行為,並以不同的方式進行控制。 本主題描述了會話在WCF應用程序中啟用的功能以及如何使用它們。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.