开发者

WCF different endpoint per method?

开发者 https://www.devze.com 2023-01-25 03:19 出处:网络
Is it possible to restrict a method in WCFService to only respond to a particular endpoint? e.g. I have a service that has multiple methods, one of which will be receiving a file.

Is it possible to restrict a method in WCFService to only respond to a particular endpoint?

e.g. I have a service that has multiple methods, one of which will be receiving a file. I have exposed two endpoints, one using MTOM.

Is it possible to only allow MTO开发者_StackOverflow中文版M for the "file" method.

If the end user wants to use MTOM for all the other calls, that their call, but I need to insist on it for the "file" method.


I believe that bindings can be specified at the ServiceContract level only. I think you would need to create a separate ServiceContract containing the method you want to use a separate binding for, then specify in the service configuration that it is to use a binding that utilizes MTOM encoding. You could go further and create a custom binding that only allows MTOM encoding.

0

精彩评论

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

关注公众号