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/

  • 相关阅读:
    sp_trace_setfilter sqlserver筛选跟踪或跟踪过滤
    sp_trace_setevent sqlserver跟踪事件及列
    通过导入虚拟电脑的方式还原centos
    sqlserver profiler 抓出来作业的代码 SQLAgent
    克隆server2008R2造成SID冲突
    sqlserver ssms ctrl+e快捷键问题
    Caffe源码解析1:Blob
    梯度下降、随机梯度下降和批量梯度下降
    Caffe CNN特征可视化
    Caffe 抽取CNN网络特征 Python
  • 原文地址:https://www.cnblogs.com/Benoly/p/3817872.html
Copyright © 2011-2022 走看看