Views: 8.6K
Replies: 1
Archived
|
Question on DPF ActionService ValidRequest methodI'm going through the ActionService WCF service, specifically the ValidRequest method and saw that the section that validates the ClientTag was commented with:
// Validate Client Tag. // Hardcoded here. In production this should query a 'client' table in a database. if ((Validate.ClientTag & validate) == Validate.ClientTag) { if (request.ClientTag != "ABC123") { response.Acknowledge = AcknowledgeType.Failure; response.Message = "Unknown Client Tag"; return false; } } Doug Doug Rohm, Dec 29, 2010
|
|
Reply 1Hi Doug,
Happy New Year! The "ABC123" value in this case can be in a Settings table in the database as a value for a setting called "ClientTag". The Settings table might be just a table with two columns (and a rowversion column), called "Name" and "Value". This can be a table with general collection of settings that can be collected in name/value pairs. So in this table you can have something like the following:
Then you can simply replace the "ABC123" string with a call to your service or repository that retrieves this value. I hope this answers your question. King Wilder if ((Validate.ClientTag & validate) == Validate.ClientTag) { var setting = settingsDao.GetAll() .Where(s => s.Name == "ClientTag").SingleOrDefault(); if (request.ClientTag != setting.Value) { response.Acknowledge = AcknowledgeType.Failure; response.Message = "Unknown Client Tag"; return false; } } King Wilder, Jan 01, 2011
Is there an example showing MVC 2 in v3.5?
Sep 09, 2010
|