• 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

  • 相关阅读:
    微信退款回调
    laravel5.5 自定义验证规则——手机验证RULE
    laravel5.5 延时队列的使用
    laravel 使用EasyWechat 3分钟完成微信支付(以APP支付为例)
    第三章预习
    预习2
    预习原码补码
    C语言ll作业01
    C语言寒假大作战04
    C语言寒假大作战03
  • 原文地址:https://www.cnblogs.com/sdaulldd/p/6004960.html
Copyright © 2020-2023  润新知