3

我是 AWC/EC2 环境的新手,并在我的 Windows Server 和 IIS 的 EC2 实例上创建了一个 .Net WCF 服务。

导航到http://www.websiteservice.com/MyWebsiteFeederService.svc?wsdl会调出 WSDL。

现在,在同样位于同一台机器上的 www.mywebsite.com 中,我已经使用了 Web 服务。不幸的是,每当我尝试通过该站点访问该服务时,我都会继续收到“访问被拒绝”错误消息:

异常详细信息:System.ServiceModel.Security.SecurityAccessDeniedException:访问被拒绝。

我不认为这与AWS-S3 错误有关 - Access is Denied错误,因为我没有使用存储桶。

在站点的 Web.config 中,我打开了跟踪侦听器并查看了服务跟踪查看器。

这些信息似乎没有用,因为这是我得到的:

[TraceRecord] 严重警告 TraceIdentifier http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ThrowingException.aspx 描述抛出异常。应用域 /LM/W3SVC/4/ROOT-2-129966419874659765

以下是警告级别的完整 XML:

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>131075</EventID>
<Type>3</Type>
<SubType Name="Warning">0</SubType>
<Level>4</Level>
<TimeCreated SystemTime="2012-11-06T02:19:47.8029428Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{b6efab70-63ad-4bdd-85c6-5c49a907c210}" />
<Execution ProcessName="w3wp" ProcessID="3472" ThreadID="1" />
<Channel />
<Computer>AMAZONA-xxxxxFFR</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Warning">
<TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Diagnostics.ThrowingException.aspx</TraceIdentifier>
<Description>Throwing an exception.</Description>
<AppDomain>/LM/W3SVC/4/ROOT-2-129966419874659765</AppDomain>
<Exception>
<ExceptionType>System.ServiceModel.Security.SecurityAccessDeniedException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message>Access is denied.</Message>
<StackTrace>
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
at MyWebsiteFeederService.IFeederService.GetWebsiteConfiguration(String websiteGuid, String websitePW)
at MyWebsiteFeederService.FeederServiceClient.GetWebsiteConfiguration(String websiteGuid, String websitePW)
at Inquiro.Models4.ModelsBaseClass.GetWebsiteConfiguration(String websiteGuid, String websitePW)
at Inquiro.Websites.MvcApplication.LoadWebsiteConfiguration()
at Inquiro.Websites.MvcApplication.Application_Start()
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct&amp; sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Web.HttpApplication.InvokeMethodWithAssert(MethodInfo method, Int32 paramCount, Object eventSource, EventArgs eventArgs)
at System.Web.HttpApplication.ProcessSpecialRequest(HttpContext context, MethodInfo method, Int32 paramCount, Object eventSource, EventArgs eventArgs, HttpSessionState session)
at System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app)
at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers)
at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context)
at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)
at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)
</StackTrace>
<ExceptionString>System.ServiceModel.Security.SecurityAccessDeniedException: Access is denied.</ExceptionString>
</Exception>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
</E2ETraceEvent>

我在另一台非亚马逊服务器上运行完全相同的服务,并且运行良好。我不记得设置任何特殊权限或“以 [用户] 身份运行” - 在 IIS 管理器权限中没有设置其他用户。

我还使用 sqlcmd 从该服务器上的命令提示符确认我可以连接到 RDS 数据库服务器。

在这一点上,我基本上是在绕圈子,希望能得到一些帮助。

谢谢。

4

1 回答 1

3

错误本身“访问被拒绝”。不是很有帮助。调试信息也不是。

最终,在这种情况下,问题在于需要将执行权限授予正在执行从 WCF 服务调用的存储过程的用户 ID。

于 2012-11-07T01:05:46.643 回答