WCF Duplex - 如何查找客户端的回调 URL?

发布于 2024-09-26 04:49:26 字数 64 浏览 0 评论 0原文

如何从服务 (WCF 3.5) 内查找双工 HTTP 绑定的客户端回调 URL?

感谢任何帮助..

How to find the Client's Callback URL for a duplex HTTP binding, from within the service (WCF 3.5)?

Appreciate any help..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

花间憩 2024-10-03 04:49:26

要在双工通道中获取对客户端的回调,您要做的是在您要调用的服务上调用的方法中,

OperationContext.Current.GetCallbackChannel<ICallbackContract>();

其中 ICallbackContract 被替换为实际的回调协定名称。

编辑:
不确定“客户端回调 URL”一词的含义。如果您指的是可以通过以下方式获取的客户地址:

EndpointAddress clientAddress = OperationContext.Current.Channel.RemoteAddress;

To get the callback to the client in a duplex channel what you do is within the method that was invoked on the service you would call

OperationContext.Current.GetCallbackChannel<ICallbackContract>();

where ICallbackContract is replaced with the actual callback contract name.

Edit:
Not sure what you mean by the phrase Clients Callback URL. If you mean the address of the client that could be obtained via:

EndpointAddress clientAddress = OperationContext.Current.Channel.RemoteAddress;
血之狂魔 2024-10-03 04:49:26

您通常可以通过

OperationContext.Current.GetCallbackChannel<T>()

其中 T 是合约中定义的 CallBack 接口的类型来找到它。

You normally find it trough

OperationContext.Current.GetCallbackChannel<T>()

Where T is the type of the CallBack interface defined in the contract.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文