开发者

How do expose my own meta data in WCF service?

开发者 https://www.devze.com 2023-03-19 07:32 出处:网络
Rather than exposing the system generated meta data I\'d like t开发者_运维百科o provide my meta data which is kept it a text file (say) on the server. I guess this means responding to the HTTP GET req

Rather than exposing the system generated meta data I'd like t开发者_运维百科o provide my meta data which is kept it a text file (say) on the server. I guess this means responding to the HTTP GET request http://[service address]?wdsl.


You could simply turn off metadata export (remove serviceMetadataBehavior or set its httpGetEnabled flag to false) and then put your WSDL document at a URL that makes sense for your app (?wsdl is a WCF / ASMX convention but its not a standard)

This is pretty easy if you are using IIS hosting but would need a REST endpoint for Self Hosting


You can develop a custom MetaExporter and then find ServiceMetadataBehavior, in that behavior, you can override the default MetadataExporter. Therefore in your MetaExporter, you can do anything you want.

0

精彩评论

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