WCF动态验证 [英] WCF Dynamic validation

查看:66
本文介绍了WCF动态验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个与WCF服务有关的方案,请仔细阅读并给我合适的解决方案,


我有2个使用单一服务的客户端,这里两个客户端的验证是不同的,如何在不更改太多代码的情况下动态执行验证?
服务端?

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 ?

推荐答案

为此,我可以建议您2件事

1.维护单独的验证DLL,该验证DLL仅包含基于客户端的验证,并且如果要将所有客户端的验证合并在一个验证dll中,则可以使用预处理器指令基于有条件的编译来分离客户端
查看预处理器指令上的示例
C Sharp中的预处理器指令 [
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


这篇关于WCF动态验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆