首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

Delphi调用C# Webservice,有关Session有关问题

2012-04-27 
Delphi调用C# Webservice,有关Session问题在Delphi,是否有类似的CookieContainer???C# code--webservice[W

Delphi调用C# Webservice,有关Session问题
在Delphi,是否有类似的CookieContainer???

C# code
--webservice[WebMethod(Description = "Hello Demo", EnableSession = true)]        public string HelloWorld()        {            if (System.Web.HttpContext.Current.Session.Count == 0)            {                return "Hello,World";            }            else            {                return "Hello World, " + System.Web.HttpContext.Current.Session["UserName"].ToString();            }        }--客户端 winformsingleWebservice = new WindowsFormsApplication1.localhost.MyService();            cookieContainer = new CookieContainer();            singleWebservice.CookieContainer = cookieContainer;


[解决办法]
GetServiceSoap 调用的 HTTPRIO 貌似不支持 Cookie
非要用的话,用 IdHttp + IdCookieManager
自己弄XML POST上去,再分析回来的XML
我记得有几个控件,对XML分析的还是不错的

热点排行