首页 新闻 会员 周边 捐助

wcf两种元数据发布方式有什么区别??

0
[已解决问题] 解决于 2013-11-04 12:48

两种发布wcf元数据的方式

1 通过制定service的behaviorConfiguration属性设置serviceMetadata 

<serviceBehaviors>
        <behavior name="ffff">
          <serviceMetadata httpGetEnabled="true" httpGetUrl="metadata"/>
        </behavior>
      </serviceBehaviors>
<service name="jqueryWCF.WCFservice" behaviorConfiguration="ffff">
<host>
<baseAddresses>
<add baseAddress="http://127.0.0.1:9999/Service"/>
</baseAddresses>
</host>
<endpoint address="" behaviorConfiguration="AllenBehavior" binding="webHttpBinding" contract="jqueryWCF.WCFservice" />

2  通过<endpoint address="mex" binding="mexHttpBinding"

 contract="IMetadataExchange" />
 <serviceBehaviors>
        <behavior name="mexBehavior">
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceMetadata httpGetEnabled="false" />
          <serviceThrottling maxConcurrentCalls="1000"  maxConcurrentSessions="1000" />
        </behavior>
      </serviceBehaviors>
<services>
      <service name="jqueryWCF.WCFservice" behaviorConfiguration="mexBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="http://127.0.0.1:9999/Service"/>
          </baseAddresses>
        </host>
        <endpoint address="" behaviorConfiguration="AllenBehavior" binding="webHttpBinding" contract="jqueryWCF.WCFservice" />
        <endpoint address="mex" binding="mexHttpBinding"
 contract="IMetadataExchange" />
      </service>
      
    </services>

1和2有什么区别吗?

wcf
koi的主页 koi | 初学一级 | 园豆:4
提问于:2013-11-03 21:44
< >
分享
最佳答案
0
奖励园豆:5
beyondchina | 小虾三级 |园豆:680 | 2013-11-04 10:51
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册