2011-05-04 138 views
0

给出该配置:WCF安全问题

<service name="WCFWSHttps.Service1" behaviorConfiguration="WCFWSHttps.Service1Behavior"> 
    <endpoint address="https://localhost/WCFWSHttps/Service1.svc" binding="wsHttpBinding" bindingConfiguration="TransportSecurity" contract="WCFWSHttps.IService1"/> 
    <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/> 
</service> 

什么用的<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>

我该如何在后面的代码中实现这个enpoint。即我有

WSHttpBinding binding; 
ServiceHost svh 

我怎么能在代码后面添加mex thingi?

回答

2

Imetadataexchange接口公开方法返回有关服务的元数据信息,如方法定义,返回类型的数据类型等。基本上,元数据将是Web服务描述语言(WSDL),并帮助客户端使用您的服务已经暴露。

所以没有必要实现它们,它们内置在WCF中。

您可以找到有关interfacte在这里更多信息IMetadataExchange

1

this展示了如何AddServiceEndpoint你的ServiceHost在后面的代码。

+0

Kbir ya scatman kbiiiiiiiiiir – 2011-05-15 09:08:24