可一个服务有多个终结?多个

2023-09-03 17:02:46 作者:▄︻┻┳═一儍儍/love愛

我们有具有只在支持的net.tcp一些设置的服务。什么是添加另一个端点的最好方法是什么?我是否需要创建一个完整的新的主机?

We have a service that has some settings that are supported only over net.tcp. What's the best way to add another endpoint? Do I need to create an entire new host?

推荐答案

一个服务可能有多个端点中的一台主机,但每个端点必须有地址,绑定和契约的独特组合。对于IIS托管服务(即一个.svc文件),只需设置端点的地址为相对的URI,并确保您的Visual Studio或Wsdl.exe用生成的客户端指定端点在其构造函数名称。

A service may have multiple endpoints within a single host, but every endpoint must have a unique combination of address, binding and contract. For an IIS-hosted service (that is, an .SVC file), just set the address of the endpoint to a relative URI and make sure that your Visual Studio or wsdl.exe generated client specifies the endpoint's name in its constructor.

另请参阅MSDN文章的 多个端点 。

See also the MSDN article Multiple Endpoints.