WCF服务问题。 [英] WCF Service question.

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

问题描述

在一次采访中,一位采访者问我:

假设我有一个wcf服务。有三种方法说A1,A2,A3。

现在我有2个客户。一个只使用A1,第二个将使用A2和A3。

那么如何保护我的A2和A3方法免受第一客户的影响?

请帮助我?

In an interview an interviewer asked me :
"Suppose I have a wcf service.There are 3 methods say A1,A2,A3.
Now I have 2 clients . One will use only A1 and second one will use A2 and A3.
So How can I protect my A2 and A3 methods from First Client?"
Please help me?

推荐答案

使用IP地址阻止



Request.UserHostAddress //使用ip地址

Request.UserHostName //使用mac地址





firstaddress 122.1.1.1

2ndaddress 111.1.1.13

检查ipaddress如果是firstaddress则阻止使用A2和A3

检查ipaddress if if secondaddress然后阻止使用A1
use IP address to block

Request.UserHostAddress // use ip address
Request.UserHostName // use mac address


firstaddress 122.1.1.1
2ndaddress 111.1.1.13
check for ipaddress if is firstaddress then block from using A2 and A3
check for ipaddress if is 2ndaddress then block from using A1


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

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