zoukankan      html  css  js  c++  java
  • 在.NET “.NET研究”4中用IIS部署WCF就这么简单

     在.NET 3.5中,我们需要这样做:

      1. 添加一个HelloService.svc文件,添加ServiceHost标记,在Service中添加WCF服务实现的名称,比如:

    上海闵行企业网站设计与制作<%@ ServiceHost Language="C#" Debug="false" Service="CNBlogs.Service.Impl.HelloService"%>上海徐汇企业网站设计与制作>

      2. 在web.config/system.serviceModel/bindings/basicHttpBinding中添加一个binding。

      3. 在web.config/system.serviceModel/behaviors/serviceBehaviors中添加一个behavior。

      4. 在web.config/system.serviceModel/services中添加一个service,并且:

      a) 设置behaviorConfiguration属性。

      b) 设置name属性。

      5. 在service下添加一个endpoint,上海企业网站设计与制作并且:

      a) 设置binding属性。

      b) 设置name属性。

    上海网站建设  c) 设置contract属性。

      在.NET 4中,我们只要这样做:

      在web.config/system.serviceModel/serviceHostingEnvironment/serviceActivations中增加下面两个属性即可:

    <add relativeAddress="HelloService.svc" service="CNBlogs.Service.Impl.HelloService"/>

      这样配置后,就可以正常调用WCF服务。

      如果需要通过SvcUtil.exe生成客户端代理,只需在serviceBehaviors中添加:

    <behavior>上海徐汇企业网站制作
    <serviceMetadata httpGetEnabled="true"/>
    </behavior>
  • 相关阅读:
    make menuconfig出现乱码
    内存中的变量和值
    is&==
    python小整数池
    生成器
    GIL
    grub rescue问题修复
    期末考试
    期末要求
    选课练习
  • 原文地址:https://www.cnblogs.com/wichell/p/2228020.html
Copyright © 2011-2022 走看看