Click here to Skip to main content
15,878,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a scenario related to WCF services, Please go through that and give me suitable solution,


I have 2 clients which are consuming single service, here validation for both clients are different, How can I perform validation Dynamically without changing much Code at
service side ?
Posted

1 solution

For this I can suggest you 2 things

1.Maintain separate validation DLL, which consists of validations only based on the client, and if you want to combine all client's validations in a single validation dll you can use preprocessor directives for separation of clients base on Conditional compilation
Look the sample on preprocessor directives
Preprocessor directives in C Sharp[^]

2. Maintain parameter table in database for all clients, because the parameter validations may vary with each and every client, so you have to pick specific client parameters from table and validate it and return validated message to main solution

Thanks

SP
 
Share this answer
 
v4
Comments
[no name] 6-Feb-12 6:29am    
Hi Sridhar,

Thank you for your valuable suggestion, Taking our discussion forward I would like to know that is there any WCF specific Feature to handle these kind of scenarios, as I am a beginner in WCF it will be great if you provide any information on this.

Thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900