2011-07-06 68 views
2

我有一个完全从localhost工作的web服务,但是当我将它托管在测试服务器上时,我在其中一个方法上发生错误。我正在使用wsHttp绑定。除了这个方法,其他所有的东西都可以正常工作。这是我得到的错误Web服务中的方法的访问被拒绝错误

客户端错误:

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) 
    at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& 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) 

服务器错误:

namespace.Service Error: 10001 : Error occurred in methodname(). 
System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security. 
    at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly) 
    at System.Diagnostics.EventLog.SourceExists(String source, String machineName) 
    at System.Diagnostics.EventLog.VerifyAndCreateSource(String sourceName, String currentMachineName) 
    at System.Diagnostics.EventLog.WriteEvent(EventInstance instance, Byte[] data, Object[] values) 
    at System.Diagnostics.EventLog.WriteEvent(EventInstance instance, Object[] values) 
    at System.Diagnostics.EventLogTraceListener.TraceEvent(TraceEventCache eventCache, String source, TraceEventType severity, Int32 id, String format, Object[] args) 
    at System.Diagnostics.TraceSource.TraceEvent(TraceEventType eventType, Int32 id, String format, Object[] args) 
    at AutoWatch.Entity.WcfService.TrackingService.UpdateIncidentStatusHistory(Int64 incidentId, String status, String username, String comment, Boolean SuspectFaultyUnit) in C:\..servicename.cs:line 566 
    at AutoWatch.Entity.WcfService.TrackingService.GetNewIncidentMessage(String username) in C:\..servicename.cs:line 444 

大会的失败是区域: 我的电脑

我在加我在服务器上遇到的错误。 是否有可能出现此错误,因为服务无法写入事件日志?

请帮忙。

+0

你到底在做什么? –

+0

它只是从数据库检索一些信息 – Yugz

+0

我已经添加了从服务器到我的文章的错误。我以前无法访问服务器 – Yugz

回答

2

确保运行托管服务的帐户的帐户具有对数据库的访问权限。例如,在IIS的情况下,运行托管服务的应用程序池的帐户必须登录到数据库服务器,并且它必须具有在数据库中执行所有必要操作的权限。

编辑:

服务器堆栈跟踪看起来相当简单。写入Windows事件日志时遇到问题!它找不到您请求的来源,并且没有创建它的权限。

+0

该帐户有权访问数据库。其他方法检索数据没有问题,只有一个问题。这在客户端的一种方法是使用后台工作人员可能是一个问题? – Yugz

+0

打开客户端和服务器上的wcf跟踪,并检查错误的详细信息http://msdn.microsoft.com/en-us/library/ms733025.aspx –

+0

服务和客户端都跟踪打开... – Yugz