当前位置:首页 > Windows程序 > 正文

它是一种绝大多数平台都能支持的简单text-based协议;另一种是元数据交换终结点

2024-03-31 Windows程序

颁布处事元数据的方法有两种:一是基于HTTP-GET协议供给元数据,它是一种绝大大都平台都能撑持的简单text-based协议;另一种是元数据交换终结点。

1.基于HTTP-GET协议

<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <services> <service behaviorConfiguration="metaExchange"> <host> <baseAddresses> <add baseAddress="http://localhost:8000/MyService"/> </baseAddresses> </host> <endpoint address="HelloWCFService" binding="wsHttpBinding" contract="HelloWCFService.IHelloWCFService"/> <!--<endpoint address="metaExchange" binding="mexHttpBinding" contract="IMetadataExchange"/>--> </service> </services> <behaviors> <serviceBehaviors> <behavior> <serviceMetadata httpGetEnabled="true"/> <!--<serviceMetadata/>--> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> </configuration>

2.元数据交换终结点

<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <services> <service behaviorConfiguration="metaExchange"> <host> <baseAddresses> <add baseAddress="http://localhost:8000/MyService"/> </baseAddresses> </host> <endpoint address="HelloWCFService" binding="wsHttpBinding" contract="HelloWCFService.IHelloWCFService"/> <endpoint address="metaExchange" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services> <behaviors> <serviceBehaviors> <behavior> <!--<serviceMetadata httpGetEnabled="true"/>--> <serviceMetadata/> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> </configuration>

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/35700.html

Jm-杰米博客Jamie
草根站长的技术交流乐园!IT不会不要紧快来好好学习吧!
  • 20786文章总数
  • 7494590访问次数
  • 建站天数
  • 友情链接