WCF中如何得到客户端信息
日期:2007年5月3日 作者: 查看:[大字体 中字体 小字体]-
以前我也问过类似的问题,都没有得到答案.
很高兴今天终于知道结果了:不能!!!!!!!!!!!!!!!!!!!!!
很遗憾啊,微软的解释是wcf封装了底层传输信息,无法得到ip,hostname这些信息...一个不是方法的方法就是客户端在OutgoingMessageHeaders告诉服务器自己的相关信息....无语了我....
相关的信息:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=717652&SiteID=1
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1174862&SiteID=1
引用两个post中的重点吧:(
David Wortendyke - MSFT:
Hello Jdang,
The NetTcpBinding wraps a TCP socket as a channel and sockets don't have any built-in feature for for providing the sender's machine-name. In other words, it isn't povided by the underlying transport so we don't have a way to surface it to you.
Do you have the option of modifying your contract so it includes the client's machine-name as one of the parameters? Alternately, you could add a message-inspector that adds the machine-name as a custom header that you then extract in your service.
Regards,
DavidClemens Vasters - MSFT :
What if you are using HTTP and the message is passing several proxies? What if you are using MSMQ? How about IPv6 addresses? What should be there when the message arrives via named pipes?
In other words: WCF abstracts away from the network details and provides a single programming model that's independent of what transport you choose. Some of those might be an abstraction over IP themselves or the concept of IP doesn't apply since they are a disk-based store & forward mechanism such as MSMQ. The additional issue of proxies and NATs adds an additional layer of complexity here. So while we might be able to give you some information bit in some cases, the quality of that information would vary from transport to transport.
- [1] [2] 下一页
-
- WCF中如何得到客户端信息 相关文章:
- ·WCF中如何得到客户端信息
- WCF中如何得到客户端信息 相关软件
- 特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作
- 者.文章版权归文章原始作者所有.对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转
- 载的文章有版权问题请联系编辑人员,我们尽快予以更正. 转载请注明来源:http://www.hackhome.com
上一篇:2.5.3 维度归约
下一篇:《数据挖掘:概念与技术》前言
精品推荐
热点TOP10
- ·BPEL模型基础
- ·Fedora 8下Apache配置与管理
- ·兵之利器 软件开发辅助工具纵览
- ·多核时代对并发程序设计的探索
- ·Enterprise Web 2.0--SOA的最后一英里
- ·BPEL的基本活动介绍
- ·DB2数据库归档日志的管理方案
- ·Web开发时碰到的问题以及心得经验
- ·基于Struts技术的Web层应用设计和实现
- ·四种网络游戏外挂的设计方法
- ·对一个加锁的表进行解锁
- ·开发WDM型的USB设备驱动程序
- ·软件架构设计的三个维度
- ·什么叫面向接口编程
- ·RPG游戏引擎的设计原理
- ·6.1.2 数据仓库的概念
- ·6.1.1 数据仓库的产生
- ·6.1 数据仓库概论
- ·5.1 Web服务概述
- ·3.7 面向对象编程的基本概念
