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/

  • 相关阅读:
    高效、稳定开发功能的一些心得
    记录一些遗忘的程序基础知识
    Linux NFS
    Nginx Upstream模块
    Redis命令总结
    手动搭建redis集群(3台)
    laravel使用总结(二)
    InnoDB体系架构总结(二)
    laravel 设计思想简单了解
    Redis原理及集群相关知识
  • 原文地址:https://www.cnblogs.com/Benoly/p/3817872.html
Copyright © 2011-2022 走看看