zoukankan      html  css  js  c++  java
  • [问题]通过IIS宿主发布WCF服务,客户端添加服务引用出错的解决办法

    环境配置:
    Web服务器:Windows Server 2008,iis7.5,.net4.0
    客户端:XPsp3 vs2010 sp1

    问题描述:
    1.确定WCF服务访问地址
      http://service.xxx.com/ActivityLogService.svc可以正常浏览
      http://service.xxx.com/ActivityLogService.svc?wsdl可以正常查看元数据    
    2.客户端添加对应service.xxx.com的host
    3.vs2010添加服务引用,提示失败

    理解了文档内容,但无法进行处理。
      - WSDL 文档包含无法解析的链接。
      - 下载“http://service.xxx.com/ActivityLogService.svc?xsd=xsd0”时出错。
      - 基础连接已经关闭: 接收时发生错误。
      - 无法从传输连接中读取数据: 远程主机强迫关闭了一个现有的连接。。
      - 远程主机强迫关闭了一个现有的连接。
    元数据包含无法解析的引用:“http://service.xxx.com/ActivityLogService.svc?wsdl”。
    元数据包含无法解析的引用:“http://service.xxx.com/ActivityLogService.svc?wsdl”。
    如果该服务已在当前解决方案中定义,请尝试生成该解决方案,然后再次添加服务引用。

    The key part of this message is the reference to the downloading of the xsd. When I tried accessing the .svc url in a browser it worked fine, but trying to access the .svc?xsd=xsd0 brings up the generic 'cannot display webpage' message.

    When you unleash your weapon (Process Monitor) on the csc.exe process (this is the compiler generating the xsd) you'll realise that the IIS identity IIS_WPG does not have access to the WindowsTemp folder. Give enough rights to the folder and viola problemo solved.

    原因就是IIS进程的用户没有访问WindowsTemp目录的权限。找到Temp目录,然后找到IIS_IUSER用户,授权即可。

    参考:
    1.http://merill.net/2008/04/wcf-add-service-reference-gotcha-with-windows-server/

  • 相关阅读:
    cve-2019-1388复现+烂土豆+CVE-2019-0803
    子父域控双向信任
    黄金票据 白银票据 ms14068
    joomla3.4.6 rce 分析与复现
    主键索引跟唯一索引的区别
    hash 跟B+tree的区别
    MySQL数据库有几种索引?分别是什么?
    什么是事务?事务有什么特性?分别是什么?
    MySQL建立索引的原则
    什么是索引?索引的作用是什么?
  • 原文地址:https://www.cnblogs.com/Benoly/p/3817872.html
Copyright © 2011-2022 走看看