Hello everyone,
first of all I am new to WCF. That is the basic problem to my problem, I know!
I want to make a call to my WCF service and in that works OK.
What I want is that each call to the Service contains a filled LoginUser object.
[Serializable]
[DataContract]
public class LoginUser
{
[DataMember]
public string UserName { get; set; }
[DataMember]
public string Password { get; set; }
}
In my Interface I state:
BLL.LoginUser LoginUser { [OperationContract] get; [OperationContract]set; }
In my service class I have:
public BLL.LoginUser LoginUser { [OperationBehavior]get; [OperationBehavior]set; }
In the client I get 2 methods (get_LoginUser() ans set_LoginUser()) but I want to see a property.
I tested with these methods and I can set the values for UserName and Password with the method, but when calling the next method my Loginuser object is NULL again.
That is why I want to have a property to set and that in the next call the LoginUser object still has the data.
I do not want to add the object of LoginUser as a parameter in the WCF call or is that the only option?
I instantiate my call to the service as:
srPersonal.IStatistics sc = new srPersonal.StatisticsClient();
I then want to do a
srPersonal.BLL.LoginUser lu = new srPersonal.BLL.LoginUser();
lu.UserName = "hi";
lu.Password = "*****";
sc.LoginUser = lu;
var result = sc.GetMyData();
What do I have to change?