我们可以从客户端读取 ServiceBehavior 属性吗
我想在客户端读取WCF服务的ServiceBehavior属性。我怎样才能做到这一点?
- 内存
I want to read the ServiceBehavior attribute of WCF service at the client end. How can I do that?
-
Ram
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这没有道理。网络边界将客户端和服务器分开,客户端看到的就是服务器公开的。例如,如果您使用 SOAP (basicHttpBinding),则客户端了解的有关该服务器的所有信息就是 WSDL。它甚至不知道该服务器是 WCF,因此在客户端中谈论
ServiceBehavior
是错误的(服务器甚至可以用其他语言编写,甚至不是 .NET)。现在,如果此服务行为向下游发送一些信息到客户端(例如一些自定义 HTTP 标头),则客户端可以读取和访问此信息,但这取决于具体场景。
This doesn't make sense. Network boundaries separate the client and the server and what the client sees is what the server exposes. For example if you are using SOAP (basicHttpBinding) all that the client knows about this server is the WSDL. It doesn't even know that this server is WCF so talking about
ServiceBehavior
in a client is wrong (the server could even be written in some other language, not even .NET).Now if this service behavior sends some information downstream to the client (for example some custom HTTP header) then the client could read and access this information, but that will depend on the specific scenario.