A windows service was developed and runs on a 32 bit machine. It communicates to the Project Web Access web service. Now, the service was moved to the same computer as the Project Web Access web service. The code fails and I recieve this error:
System.Net.WebException: The request failed with HTTP status 401: Unauthorized. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at ProjToolService.ProjectWebSvc.Project.ReadProject(Guid projectUid, DataStoreEnum dataStore)
at ProjToolService.Queue.AssignResource(Guid queueId, Guid projectId, Guid taskId, Guid resourceId, Guid assignmentId)
It may not be the 32bit vs 64bit, but I have no other ideas.
The target platform is x86, but it also failed using AnyCPU. I tried using DefaultCredentials and System.net.CredentialCache.DefaultNetworkCredential as well.
Thanks for all the help & attention but i finally discovered the problem. The problem was the issue of the win service running locally with the web service. This problem was specific to the Windows server 2003 operating system. to resolve the problem i had to create a New Value in the registry editor called DisableLoopbackCheck, and set it to 1.