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>
的用途是什么?
我怎样才能在代码后面实现这个enpoint。即我
WSHttpBinding binding;
ServiceHost svh
如何在代码后面添加墨西哥事物?
given this configuration :
<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>
what is <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
used for?
and how can i implement this enpoint in code behind. ie i have
WSHttpBinding binding;
ServiceHost svh
how can i add the mex thingi in code behind?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Imetadataexchange 接口公开了返回有关服务的元数据信息的方法,例如方法定义、返回类型的数据类型等。基本上元数据将是 Web 服务描述语言 (WSDL),并帮助客户端使用您所公开的服务。
所以不需要实现它们,它们内置在 WCF 中。
您可以在此处找到有关接口的更多信息 IMetadataExchange
Imetadataexchange interface exposes methods to return the metadata information about the service like the method definition, data types of the return type etc. Basically metadata will be Web Services Description Language (WSDL) and helps the client to consume the service which you have exposed.
So there is no need to implement them and they are inbuilt in WCF.
You can find more info about the interfacte in here IMetadataExchange
此展示了如何在代码隐藏中将 AddServiceEndpoint 添加到 ServiceHost。
this shows how to AddServiceEndpoint to your ServiceHost in code behind.