forum

Home / DeveloperSection / Forums / Call dynamic webservice with session

Call dynamic webservice with session

Jayden Bell 1537 22-Aug-2014

I have webservice, provide to user. User must login to use it. My problem is when user login through WSLogin on webservice, I want to save session to check for a next time.

[WebMethod(EnableSession = true)]
public string WSLogin(string username, string password)
{
    // do something
    string sID = Guid.NewGuid().ToString();
    Session.Add("SID", sID); // save session
    return sID; // return to user to check next time
}
[WebMethod(EnableSession = true)]
public string CallSomethingService(string sID)
{
    string curSID = Session["SID"].ToString() // error, Object reference not set to an instance of an object.
    // do some thing
}

I call webservice dynamically. Thank for all help


Updated on 22-Aug-2014

Can you answer this question?


Answer

1 Answers

Liked By