zoukankan      html  css  js  c++  java
  • wcf 同时支持webhttp 和 引用方式

    wcf 实现参考

    http://www.cnblogs.com/mingmingruyuedlut/p/4223116.html

    兼容两种方式  

    1、修改服务端webconfig

    <system.serviceModel>
        
        <services>
          <service name="xxx" behaviorConfiguration="Default">
            <endpoint address="" behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="basicTransport" contract="Ixxx"/>/*提供WebGet服务用*/
            <endpoint address="Wcf" binding="basicHttpBinding" contract="Ixxx"/>/*提供WCF服务 , 注意address='Wcf',为了区分开与WebGet的地址,添加引用之后会自动加上的 */
            <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex"/>/*元数据endpoint*/
          </service>
        </services>
        
        <behaviors>      
          <serviceBehaviors>        
            <behavior name="Default">
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="true"/>
            </behavior>        
            <behavior name="">
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="true"/>
            </behavior>        
          </serviceBehaviors>
          
          <endpointBehaviors>
            <behavior name="web">
              <webHttp helpEnabled="true"/>
            </behavior>
          </endpointBehaviors>
        </behaviors>
        
        <bindings>
          <webHttpBinding>
            <binding name="basicTransport"/>
          </webHttpBinding>
        </bindings>
    
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
        
      </system.serviceModel>

    Web调用地址:http://ip:port/xxx.svc/yyy/id

      Wcf服务地址会变为:http://ip:port/xxx.svc/Wcf

  • 相关阅读:
    pyqt的setObjectName()/findChild()
    pyqt的多Button的点击事件的槽函数的区分发送signal的按钮。
    分布式存储
    QTableWidget的表头颜色设置
    QListView的子项的ViewMode
    QHeaderView的点击和双击事件
    LeetCode(63):不同路径 II
    LeetCode(62):不同路径
    LeetCode(61):旋转链表
    LeetCode(60): 第k个排列
  • 原文地址:https://www.cnblogs.com/sdaulldd/p/6004960.html
Copyright © 2011-2022 走看看