ksoap session web service

无人久伴 提交于 2019-12-08 09:33:39

问题


How can i maintain the session state using ksoap? I need a way to receive and send the unique SessionID from the asp.net web service.

So i wrote a simple web service, but the result is always 1....

[ScriptMethod]
[WebMethod(EnableSession = true)]
public string Calculate()
{
    if (Session["example"] == null) { Session["example"] = 0; }
    int r = Convert.ToInt32(Session["example"]);
    r = r + 1;
    Session["example"] = r;
    return Session["example"].ToString();   
}

I know that i somehow need to get the SessionID from the cookie send back from the server, and use it on every new call to the service, but dont know how to do it. Im making the call from an Android application

来源:https://stackoverflow.com/questions/12664849/ksoap-session-web-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!