• IIS7 发布WCF


    Windows Vista下IIS 7发布WCF设置步骤稍微有些繁琐.

    1

    1. Control Panel -> Programs and Features -> Turn Windows features on or off -> Internet Information Services:
    选中Web Management Tools -> IIS 6 Management Compatibility -> IIS Metabase and IIS 6 configuration compatibility.
    World Wide Web Services -> Application Development Features下:
    选中.NET Extensibility, ASP.NET, ISAPI Extensions, ISAPI Filters.
    选中World Wide Web Services -> Security -> Basic Authentication.
    单击OK(上面这些在默认安装IIS 7以后是不会自动安装的).

    2

    2. 因为IIS 7默认没有提供对*.svc的扩展映射, 所以需要通过WCF的ServiceModelReg.exe注册.
    Run as administrator cmd
    "C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe -i"
    注册成功以后就可以看到IIS 7支持(查看Handler Mappings)

    3

    3. 添加IIS_IUSERS和NETWORK SERVICE的访问权限. 选中相应目录添加IIS_IUSERS, 勾选上Read&Execute, List Folder Contents, Write等.

    4

    4. Application Pool的Managed Pipeline Mode不要使用Integrated, 改为Classic. 这是我今天最郁闷的地方, 最后就是改了这个Success.

    5. 如果WCF是由Silverlight调用, 需要在host添加一个名为ClientAccessPolicy.xml的文件. 用它来设置cross-domain-access的策略. 否则Silverlight应用程序调用失败.具体每个元素含义可以查阅MSDN的Network Security Access Restrictions in Silverlight 2这篇文章.
    //ClientAccessPolicy.xml
    <?xml version="1.0" encoding="utf-8" ?>
    <access-policy>
    <cross-domain-access>
    <policy>
    <allow-from http-request-headers="*">
    <domain uri="*" />       
          </allow-from>
    <grant-to>
    <resource path="/" include-subpaths="true" />       
          </grant-to>     
        </policy>   
    </cross-domain-access>
    </access-policy>

  • 相关阅读:
    miniprogramer--ajax
    miniprogram 获取两点之间的距离(经纬度)
    express node-schedule
    express generate xls
    protected default
    Java UUID
    关于轮播图兼容的问题
    关于git上的一些错误信息
    cookie
    关于ajax原理介绍
  • 原文地址:https://www.cnblogs.com/mmmhhhlll/p/1590912.html
Copyright © 2020-2023  润新知