![](/img/trans.png)
[英][WCF Duplex]Could not find endpoint element that references contract in the ServiceModel client configuration section
[英]How to get server endpoint address from client callback method (wcf duplex contract)
我有一个双工WCF合同,我想从客户端回调方法获取服务器端点地址(我使用的是单个客户端和许多服务器,所以我想知道哪个服务器响应我)。 有没有办法从OperationContext获取它?
public class CallbackService : IServiceCallback
{
public void OnSuccess()
{
string endpoint = OperationContext.Current.?
MessageBox.Show(string.Format("Process on {0} successfully finished!", endpoint));
}
}
我看到了这个问题并尝试了解决方案,但它对我无意义地回应:“ fe80 :: 1845:e7eb:abbb:77aa%13”。
这就是我想要得到的:
<endpoint address="http://localhost:5678/WinFormsHoster/wsDual">
提前致谢!
这是正确的地址,您正在使用IPv6。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.