开发者

How to specify the <useRequestHeadersForMetadataAddress/> behavior with attribute in WCF?

开发者 https://www.devze.com 2022-12-28 13:58 出处:网络
I have a .NET WCF Rest endpoint configured through attributes (instead of using the web.config). I would like to achieve the <useRequestHeadersForMetadataAddress/> behavior with attributes. Any

I have a .NET WCF Rest endpoint configured through attributes (instead of using the web.config). I would like to achieve the <useRequestHeadersForMetadataAddress/> behavior with attributes. Any idea how t开发者_开发技巧o do that?


This question doesn't make sense. WCF Rest endpoint is not configured by attributes. REST service contract is using attributes to define needed web methods. Endpoint still has to be configured either by service host, service host factory or in configuration.

UseRequestHeadersForMetadataAddress is used to correctly set addresses in WSDL based on host header used when requesting WSDL. It cannot be set by attributes. Moreover WSDL in WCF is not able to describe REST service so there is no reason to use this behavior with REST service.

0

精彩评论

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