2014-02-06 55 views

回答

0

想通了!

ServiceSecurityAuditBehavior newAudit = new ServiceSecurityAuditBehavior(); 
      newAudit.AuditLogLocation = AuditLogLocation.Application; 
      newAudit.MessageAuthenticationAuditLevel = AuditLevel.SuccessOrFailure; 
      newAudit.ServiceAuthorizationAuditLevel = AuditLevel.SuccessOrFailure; 
      newAudit.SuppressAuditFailure = false; 



      serviceHost.Description.Behaviors.Remove<ServiceSecurityAuditBehavior>(); 
      serviceHost.Description.Behaviors.Add(newAudit);