I wrote some additional code for the OnPublishEnd event. In this event I called a method in a webservice. The webservice is running on the same server as Sitecore. The webservice works fine when called by the URL. However, if I publish the site, I get the following error:
The problem is not with Sitecore but with ASPNET security. Please take a look at this URL: http://blogs.msdn.com/habibh/archive/2005/05/25/421954.html
There are two ways to fix this error.
Service1 WS = new Service1();
WS.PreAuthenticate = false;
WS.Credentials = System.Net.CredentialCache.DefaultCredentials;
string helloWord = WS.HelloWorld();
Log.Info("Calling WebService is Ok: " + helloWord, this);