开发者

Why does SvcUtil create a Channel interface that derives from IClientChannel

开发者 https://www.devze.com 2022-12-19 05:06 出处:网络
When you create code from a WSDL file using SvcUtil.exe, among the many types created 开发者_Python百科is an interface that derives from both the service interface and IClientChannel.

When you create code from a WSDL file using SvcUtil.exe, among the many types created 开发者_Python百科is an interface that derives from both the service interface and IClientChannel.

If, for example, the created service interface is called IMyService, it also creates this interface:

public interface IMyServiceChannel : 
    IMyService, System.ServiceModel.IClientChannel

Why does it define this interface? As far as I can see, it's not referenced from anywhere in the auto-generated code.


[UPDATE]

Found a link on MSDN (scroll to the very bottom). Nothing implements it, but you can use it when using ChannelFactory directly.

It's there so that users can have intelisense for both your service interface and WCF infrastructure in one place.

I remember someone from MS talking about it on a podcast or some blog...


Have you tried wsdl.exe? "svcutil /?" will show you the supported values for /tcv (target clr version).

0

精彩评论

暂无评论...
验证码 换一张
取 消