服务如何知道调用者? [英] How can service know the caller?

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

问题描述

我有一个 WCF 服务.我如何知道对我的服务的调用是来自本地机器还是来自网络的机器?

I have a WCF service. How can i know if the call to my service comes from local machine or a machine from network?

谢谢,阿德里亚

推荐答案

您可以查看来电者的 IP.如果是从本地机器应该是127.0.0.1".您可以从 OperationContext 对象中获取调用者的 IP(远程地址).更多信息在这里:http:///www.danrigsby.com/blog/index.php/2008/05/21/get-the-clients-address-in-wcf/

You could check the IP of the caller. If it is from the local machine should be "127.0.0.1". You can get the IP of the caller (the remote address) from the OperationContext object. More info here: http://www.danrigsby.com/blog/index.php/2008/05/21/get-the-clients-address-in-wcf/

这篇关于服务如何知道调用者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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