我很难将网站部署到 Windows Server 2008 上的 IIS 7。该站点工作正常,直到它尝试调用托管在同一主机上的 WCF 服务。
当使用完全相同的 Web 配置等在 Visual Studio 20008 中运行 Web 时,一切都适用于我的工作站上的服务。只要我将 Web 部署到服务器 Bam 上的虚拟目录中。身份验证错误。当两者都部署在 Windows 2003 Server 上时,它也可以正常工作。导致此问题的 Server 2008 有何不同?帮助!请。
如果它很重要,所有服务操作都需要 ASP.net 页面的经过身份验证的用户的 Active Directory 组成员身份,并且装饰为:[PrincipalPermission(SecurityAction.Demand, Role = "SOAMemberShipService")]
我从网站收到以下错误:
由于身份验证失败,无法满足对安全令牌的请求。说明:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。
异常详细信息:System.ServiceModel.FaultException:由于身份验证失败,无法满足对安全令牌的请求。
源错误:
第 919 行:
第 920 行:公共 HSMembersService.MemberSearchResult SearchMembers(HSMembersService.MemberSearch MemberInfoToSearch) { 第 921 行:返回 base.Channel.SearchMembers(MemberInfoToSearch); 第 922 行:} 第 923 行:}
源文件:c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\csrweb\a4d18657\a6d0910d\App_WebReferences.jgx1svpr.0.cs 行:921
堆栈跟踪:
[FaultException:由于身份验证失败,无法满足对安全令牌的请求。] System.ServiceModel.Security.SecurityUtils.ThrowIfNegotiationFault(Message message, EndpointAddress target) +6375432 System.ServiceModel.Security.IssuanceTokenProviderBase`1.ThrowIfFault(Message message, EndpointAddress 目标)+25 System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody(消息incomingMessage,SspiNegotiationTokenProviderState sspiState)+173
[SecurityNegotiationException:调用者未通过服务身份验证。] System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +4596611 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type ) +1713 HSMembersService.IHSMembersService.SearchMembers(MemberSearch MemberInfoToSearch) +0 HSMembersService.HSMembersServiceClient.SearchMembers(MemberSearch MemberInfoToSearch) 在 c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\csrweb\a4d18657\a6d0910d \App_WebReferences.jgx1svpr.0.cs:921 _default.btnSearch_Click(Object sender, EventArgs e) in e:\CSRWeb\default.aspx.cs:114 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +131 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140 System.Web.UI。Page.RaisePostBackEvent(IPostBackEventHandler sourceControl,字符串 eventArgument)+39 System.Web.UI.Page.ProcessRequestMain(布尔 includeStagesBeforeAsyncPoint,布尔 includeStagesAfterAsyncPoint)+3215
ASP.net 网站的 web.config(相关服务部分):
服务 web.config:
<!-- Service Endpoints -->
<!-- Unless fully qualified, address is relative to base address supplied above -->
<endpoint address ="" binding="wsHttpBinding" contract="HSMembersService.IHSMembersService" bindingConfiguration="wsHttpBindingConfig">
<!--
Upon deployment, the following identity element should be removed or replaced to reflect the
identity under which the deployed service runs. If removed, WCF will infer an appropriate identity
automatically.
-->
<!--<identity>
<dns value="localhost"/>
</identity>-->
</endpoint>
<!-- Metadata Endpoints -->
<!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. -->
<!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="wsHttpBindingConfig" >
<security mode="Message">
<message clientCredentialType="Windows" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="HSMembersService.HSMembersServiceBehavior">
<!-- To avoid disclosing metadata information,
set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="True"/>
<serviceAuthorization principalPermissionMode="UseWindowsGroups" />
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="True" /><!-- Change this before deployment -->
</behavior>
</serviceBehaviors>
</behaviors>