【发布时间】:2011-04-15 04:11:39
【问题描述】:
问题
System.ServiceModel.Security.SecurityAccessDeniedException : Access is denied.
相关堆栈行(减少)
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
环境
开发机器(主机):Windows Vista、Visual Studio 2008、nUnit
测试机(访客):Windows 2003、IIS、Windows 2003 防火墙(禁用)
虚拟机:虚拟 PC
网络:Microsoft 环回适配器
说明
Windows 2003 托管 WCF 服务清单,其中的服务经过良好测试。
当应用程序使用者在 Windows 2003 中运行时 - 一切正常。
当应用程序使用者从 Windows Vista(在此虚拟网络下)运行时 - 出现安全问题。因此需要调整服务并包含证书。遵循了文档,但访问仍然被拒绝。
目的
不需要复杂的安全安排 - 只需一台笔记本电脑和虚拟机。
我试图复制这个官方场景:http://msdn.microsoft.com/en-us/library/ms733938.aspx
我想使用单元测试应用程序 (nunit) 从我在 Windows Vista 操作系统下的应用程序调用托管在 Windows 2003 上的服务。在 windows 2003 上部署的服务是经过良好测试的。
什么有效
任何使用(或过去的 .asmx 网络服务)的服务都可以正常工作。
怀疑
我相信它必须与这个被阻止的 Windows Vista 一起使用。 Windows 2003 事件日志有成功的审核条目。
服务设置
在 Windows Vista 上运行的消费者 - nunit 应用程序:
<system.serviceModel>
<client>
<endpoint address="http://soa.homolog.com/RemoteService/RemoteService.svc"
binding="wsHttpBinding"
behaviorConfiguration="InternetEndpointBehavior"
bindingConfiguration="AnonymousBindingConfiguration"
contract="RemoteService.IRemoteService"
name="WSHttpBinding_IEmpresaService">
<identity>
<dns value="homologCertificate" />
</identity>
</endpoint>
</client>
<bindings>
<wsHttpBinding>
<binding name="AnonymousBindingConfiguration">
<security mode="Message">
<message clientCredentialType="None" />
</security>
</binding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="InternetEndpointBehavior">
<clientCredentials>
<serviceCertificate>
<authentication certificateValidationMode="None" />
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
托管在 IIS/Windows 2003 上的服务:
<system.serviceModel>
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://soa.homolog.com" />
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
<bindings>
<wsHttpBinding>
<binding name="BindingNoSecurity">
<security mode="Message">
<message clientCredentialType="None"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="CompanyCoreBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug
includeExceptionDetailInFaults="true" />
<serviceThrottling
maxConcurrentCalls="500"
maxConcurrentInstances="500"
maxConcurrentSessions="500" />
<serviceTimeouts
transactionTimeout="00:10:00" />
<serviceCredentials>
<serviceCertificate
findValue="homologCertificate"
storeLocation="LocalMachine"
x509FindType="FindBySubjectName"
storeName="My"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
【问题讨论】:
-
您使用的是哪个虚拟机提供商?虚拟 PC 还是 VMWare?
-
嗨 Chuck Haines,虚拟 PC..
-
很好的问题描述!请问您为什么在证书指定 None 时坚持使用消息安全性?
-
还有“当应用程序使用者在 Windows 2003 中运行时 - 一切正常。当应用程序使用者从 Windows Vista(在此虚拟网络下)运行时 - 出现安全问题。”这是否意味着服务器和客户端都在单独的 VPC 中运行?
-
我假设您已经关闭了 Windows 2003 机器上的防火墙?
标签: wcf windows-vista iis-6 virtual-machine