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分析的还是不错的