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/

  • 相关阅读:
    elementui问题汇总
    微信小程序实现微信授权登录
    微信小程序数据存储
    小程序使用第三方服务,需要中转到一个h5页面,返回到指定页面
    小程序开发,通过左上角返回到指定页面
    万恶之源-基本数据类型(list,tuple)
    基础中的基础
    mybatis_plus实现自动填充和逻辑删除
    本地端口占用解决方案
    maven定义版本以来报红解决方案
  • 原文地址:https://www.cnblogs.com/Benoly/p/3817872.html
Copyright © 2011-2022 走看看