c# - Web service cannot write to Event Log when called by anonymous user -


summary: How to configure a web service, such as writing an event log is always possible (regardless of the caller) ? Description: I have a web service that writes an entry in the application log. I installed Event Source through a little console application and I think I understand that part of things. When I do this WS test, I think I am successfully writing my entry in the event log.

The virtual directory that hosts this host, allows no anonymous access and is configured only for integrated Windows authentication.

I have a web client application that calls this webservice when Web Client site is configured for integrated Windows Aith, then calls website service results to login as desired

However, if I change the web client site to allow mismatched access, then an unknown operation exception I ignore it but it would be good to know how to get into the webservice. How to get it, how is it called? Here's a little bit of my code:

  public fileService () {try !! EventLog.SourceExists (g_EventSource)} EventLog.CreateEventSource (g_EventSource, g_EventLog); System.Security.Principal.WindowsIdentity UserIdentityInfo; UserIdentityInfo = System.Security.Principal.WindowsIdentity.GetCurrent (); String AuthType = UserIdentityInfo.AuthenticationType; If (AuthType == "Kerberos") {engineWSE.Credentials = System.Net.CredentialCache.DefaultCredentials; } Other {engineWSE.Credentials = New System.Net.NetworkCredential ("U", "P", "Domain"); } EventLog.WriteEntry (g_EventSource, "Collar:" + UserIdentityInfo.Name + "AuthType:" + UserIdentityInfo.AuthenticationType, EventLogEntryType.Information, 1); } Hold (invalid operation exception E) {// Nothing to ignore: "MyappSourceName 'can not open the log for the source. You may not have access to write." }}  

is indexed for example in the manufacturer of the above (I am mainly interested in being able to write information related to errors in the web service).

I hope the web service is a way of configuring a virtual directory (or code inside) so that logging is possible how it's called.

Do your web Config should also see.

If IIS is set up anonymous and web Configure is set to windows / impersonation then it is an anonymous IIS user who is trying to write in the event log.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -