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/

  • 相关阅读:
    初级Springboot(一)
    java.lang.NoClassDefFoundError: Could not initialize class xxx
    Python requests.post嵌套多层json参数调用接口
    weblogic安装部署war包——windows
    angularJs 页面{{xxx}}使用三目运算符
    liunx下误删除/var目录下的empty文件,导致ssh连接不上
    Java判断一个时间是否在时间区间内
    centos7下配置免密码登录
    左连接去重(objec)
    java util.Date和sql.Date转换(时区转换)
  • 原文地址:https://www.cnblogs.com/Benoly/p/3817872.html
Copyright © 2011-2022 走看看