我知道 UDDI 和 Ws-Discovery 之间的区别(熟知搜索服务与广播的位置)。但我的问题是:在 WCF 中发现 Web 服务的最简单方法是什么?最简单的意思是 WCF 中已经实现了哪些内容并且现在可以使用?我没有在 WCF 中看到任何针对 UDDI 或 Ws-Discovery 的内置实现。
您有关于 WCF 中这两个协议(protocol)的任何链接或经验可以分享吗?
更新
现在我正在考虑三种解决方案,等待 .NET 4.0 上的 WS 发现,或者使用 WCF 提供的对等绑定(bind)创建我自己的发现绑定(bind)。这样我就可以广播请求。 或者使用eed3si9n链接提供的实现。
我想我会做一个网关接口(interface)来轻松更改后面的实现。
最佳答案
.NET 4.0 将具有 WS-Discovery。请参阅Messaging enhancements in .NET 4.0: (Discovery Part I) Using WS-Discovery in WCF 4.0 。与此同时,Claudio Masieri 提供了一个实现。请参阅WS-Discovery for WCF .
还有一个以与 UDDI 类似的方式完成的自定义发现实现。请参阅Windows Communication Service Discovery .
Imagine you have 200 clients using your funky Wcf service. They would all have in their conf file a section like this one:
<client>
<endpoint configurationName="default"
address="http://localhost/servicemodelsamples/service.svc"
binding="wsHttpBinding"
bindingConfiguration="Binding1"
contract="IDataContractCalculator" />
</client>
<bindings>
<wsHttpBinding>
<binding configurationName="Binding1" />
</wsHttpBinding>
</bindings>
Now, you decide to change the existing endpoint (server side) with a new one that uses SSL for security reason. How do you update your clients? You can quickly see that it can become tedious. So the idea I want to detail here is to implement a discovery service similar to what UDDI does and to use a metadata resolver to get the configuration out of the service in order to create dynamically a proxy allowing the client to discuss with the service.
此人与您有类似的担忧,并且似乎有一个可行的解决方案。
关于.net - WCF 中的 Web 服务发现 : Ws-Discovery or UDDI?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/647816/