Fun with WebServices
Developing WebServices is fun. Redefining the word FUN of course to something the oposite of course. The windows security model seems to be written to annoy rather than to protech.
For instance PRB: “Requested Registry Access Is Not Allowed” Error Message When ASP.NET Application Tries to Write New EventSource in the EventLog gives a couple of solutions to the problem. Firstly the registry hack on this page gives an easy solution, but of course I have not got it to work.
And the preferred microsoft solution? Well, wite a short bit of code… And compile it as a DLL
Imports System.Diagnostics
Imports System.Configuration.Install
Imports System.ComponentModel
Public Class MyEventLogInstaller
Inherits Installer
Private myEventLogInstaller As EventLogInstaller
Public Sub New()
' Create an instance of 'EventLogInstaller'.
myEventLogInstaller = New EventLogInstaller()
' Set the 'Source' of the event log, to be created.
myEventLogInstaller.Source = "TEST"
' Set the 'Log' that the source is created in.
myEventLogInstaller.Log = "Application"
' Add myEventLogInstaller to 'InstallerCollection'.
Installers.Add(myEventLogInstaller)
End Sub
End Class
Of course this gives me a great view of security. After all, what hacker would not think of actually adding a DLL to do something that has security implications as extreme as writing to the DLL… So far I have spent most of my morning on debugging this issue, and things are not helping… Having to do most of the debugging remote does not help either…
It is all good learning experience though… Maybe I should just RTFM. I have learned how to install a WebService for IIS though… Just like a normal install, just install it to the IIS directory. Simple like it should be. On the other hand why VB.NET needs to edit a WebService through WebDAV or similar mechanism I do not know…
But anyway it is now a bit after 1pm and time for breakfast.
[Several hours later]
Found the problem(s). Basically I had a few.
* Two missing stored procedures in the database that did not import correctly
* VBNull in some text strings
* A recursive function that would recurse almost infinitely if an object pointed at itself.
With these fixed, things are improved significantly… At least the software does not immediately crash.