Hi All,
I have a WCF Service Contract with a simple interface defining a few methods and properties. When using the Service I would like the client side object to set a few properties and then call methods as needed (my instances are per session). This way they don't have to pass a ton of parameters in the methods. Is this possible? So far only the methods affixed with the "OperationContract" attribute are exposed.
A possible solution to my problem is to have an InitialMethod that passes parameters which are then set to private members on the server instance. All other methods can then reference those private members. However I wonder if the latter is possible.
Thanks for any info on this.
Code Ex:
So instead of:
MyFTPService.SendFile(host, user, pass, fileToSend);
MyFTPService.GetFIle(host, user, pass, fileToGet);
I would like:
MyFTPService.Host = "177.77.77.7";
MyFTPService.User = "user";
MyFTPService.PW = "pw";
MyFTPService.SendFile(fileToSend);
MyFTPService.GetFIle(fileToGet);
My Workaround:
MyFTPService.Initialize(host, user, pw);
MyFTPService.SendFile(fileToSend);
MyFTPService.GetFIle(fileToGet);