[WCF] Simple login
- by Tr?n Qu?c Bình
Hi everybody,
I have a WCF service like this:
[ServiceContract( SessionMode=SessionMode.Required)]
public interface IService
{
[OperationContract(IsInitiating = true, IsTerminating = false)]
void login(string id);
[OperationContract(IsInitiating = false, IsTerminating = false)]
string getdata();
}
public class Service : IService
{
public void login(string hashedid)
{
if (username != "someusername" || password != "somepassword")
{
// can not get data
}
else
{
// can get data
}
}
public string getdata()
{
return "these are data";
}
}
How can I write the method login and create the client application?
Thanks you.