title: Access Denied Error for a method in web service
body: <p>I have a webservice that works perfectly from localhost but when I hosted it on the testing server I get an error on one of the methods. I am using wsHttp Binding. everything else works fine on the client side except for this method. This is the error that I am getting</p>
  
  <p>client error:</p>
  
  <pre><code>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&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)
  </code></pre>
  
  <p>Server error:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>The Zone of the assembly that failed was:
  MyComputer</p>
  
  <p>I added in the error I am getting on the server.
  Is it possible I am getting this error because the service cannot write to the event log?</p>
  
  <p>Please help.</p>