0

我是 wcf 的新手,很想探索 wcf 的各个部分。我得到了这个网址http://msdn.microsoft.com/en-us/library/ee358762%28v=vs.110%29.aspx

从这里我看到存在许多不同类型的端点,但我不知道这些并且从未使用过它

<endpoint address="net.tcp://localhost:5555/Calculator" binding="netTcpBinding"
contract="CalculatorInterFace.ICalculator" name="NetTcpBinding_ICalculator" />

我了解端点,它将具有服务地址 url 和合同名称和端点名称。

这是所有不同类型的端点

AnnouncementEndpoint
    A standard endpoint that is used by services to send announcement messages.

DiscoveryEndpoint
    A standard endpoint that is used by services to send discovery messages.

UdpDiscoveryEndpoint
    A standard endpoint that is pre-configured for discovery operations over a UDP multicast binding. 

UdpAnnouncementEndpoint
    A standard endpoint that is used by services to send announcement messages over a UDP binding. 

DynamicEndpoint
    A standard endpoint that uses WS-Discovery to find the endpoint address dynamically at runtime.

ServiceMetadataEndpoint
    A standard endpoint for metadata exchange.

WebHttpEndpoint
    A standard endpoint with a WebHttpBinding binding that automatically adds the WebHttpBehavior behavior

WebScriptEndpoint
    A standard endpoint with a WebHttpBinding binding that automatically adds the WebScriptEnablingBehavior behavior.

WebServiceEndpoint
    A standard endpoint with a WebHttpBinding binding.

WorkflowControlEndpoint
    A standard endpoint that enables you to call control operations on workflow instances.

WorkflowHostingEndpoint
    A standard endpoint that supports workflow creation and bookmark resumption.

那么我怎么知道我应该使用哪个端点以及何时使用?我怎么知道不同类型端点的语法是什么样子的。请尽可能多地讨论。谢谢

4

1 回答 1

0

您应该使用符合您要求的端点。您需要阅读一本关于 WCF 的好书,以了解各种端点的优缺点。

例如,互操作性可能是一项要求。那么 Basic-Http 或 Ws-Http 可能适合。也许安全是一项要求,那么 Ws Fderation 绑定可能会很有用。也许您的要求是性能并且保证您在同一台机器上,那么它可能是命名管道绑定。

除了“读一本关于它的好书”之外,没有确凿的答案。

于 2014-02-07T08:58:18.430 回答