none
Sporadic System.ServiceModel.Security.SecurityAccessDeniedException: Access is denied. RRS feed

  • Question

  • We have a WCF Service used by many ASP.NET web applications and it works fine for the most part.  At some point every day now, the invoking applications will throw Access is denied exceptions (sample below).  After the initial occurrence, this exception occurs on every call to the service for about 2-3 minutes, and then gracefully stops, and things work normally again.  The service has been being used successfully for quite some time.  Only until a few months ago have we been seeing this behavior.  It is getting worse each day.  Any ideas?

    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)

    Exception rethrown at [0]:

       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

       at TimeTracker.ApplicationServices.HumanResourcesService.IHumanResourcesService.GetEmployeeByUserName(String username)

     
    Monday, December 8, 2014 5:49 PM

All replies

  • Hi magellings,

    >>System.ServiceModel.Security.SecurityAccessDeniedException: Access is denied.

    Based on your description, I know that when calling the WCF Service, sometimes it will throw the acess is denied exception, then could you please tell us what authentication type that you are using? Since the service has been used successfully for quite some time, so I wonder if you have done some update on your code or visual studio.
    Please try to set the following security mode to see it can help:

    <security mode="None">
    </security>

    If it can work, then it will be something with the permission.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, December 9, 2014 6:16 AM
    Moderator
  • Code hasn't changed.

    <

    basicHttpBinding>

            <

    bindingname="BasicHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="1543503872" maxBufferPoolSize="1543503872" maxReceivedMessageSize="1543503872" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">

              <

    readerQuotasmaxDepth="1543503872" maxStringContentLength="1543503872" maxArrayLength="1543503872" maxBytesPerRead="1543503872" maxNameTableCharCount="1543503872" />

              <

    securitymode="TransportCredentialOnly">

                <

    transportclientCredentialType="Windows" proxyCredentialType="None" realm="" />

                <

    messageclientCredentialType="UserName" algorithmSuite="Default" />

              </

    security>

            </

    binding>

          </

    basicHttpBinding>

    Tuesday, December 9, 2014 1:43 PM
  • The following configuration taken from MSDN can be applied to enable tracing on your WCF service.

    <configuration>
      <system.diagnostics>
        <sources>
          <source name="System.ServiceModel"
                  switchValue="Information, ActivityTracing"
                  propagateActivity="true" >
            <listeners>
                 <add name="xml"/>
            </listeners>
          </source>
          <source name="System.ServiceModel.MessageLogging">
            <listeners>
                <add name="xml"/>
            </listeners>
          </source>
          <source name="myUserTraceSource"
                  switchValue="Information, ActivityTracing">
            <listeners>
                <add name="xml"/>
            </listeners>
          </source>
        </sources>
        <sharedListeners>
            <add name="xml"
                 type="System.Diagnostics.XmlWriterTraceListener"
                 initializeData="Error.svclog" />
        </sharedListeners>
      </system.diagnostics>
    </configuration>

    Vote if help you

    Wednesday, January 7, 2015 4:31 AM