The request failed with HTTP status 401: Unauthorized.

M

ma.benamor

i'm devloped a preevntHandler but when i instal the dll in the gac it
not work The request failed with HTTP status 401: Unauthorized.
where is the problem?

namespace ClassLibrary3
{
public class Class1 : ProjectEventReceiver
{
private wsproject7.Project projws = null;
private wsproject7.ProjectDataSet projectDS = null;
private Guid projGuid;
#region Proprietes
public wsproject7.Project projwsprop
{
get
{
if (this.projws == null)
{
this.projws = new wsproject7.Project();
this.projws.Url = "myurlserver"+"/_vti_bin/PSI/
Project.asmx";
this.projws.CookieContainer = new
CookieContainer();
this.projws.Credentials =
CredentialCache.DefaultCredentials.GetCredential(new Uri(projws.Url),
"NTLM").GetCredential(new Uri(projws.Url), "NTLM");
}
return this.projws;
}

}
#endregion
public override void OnPublished(PSContextInfo contextInfo,
ProjectPostPublishEventArgs e)
{
EventLog myLog = new EventLog();
myLog.Source = "Project Event Handler";
string projectName = e.ProjectName.ToString();
int eventId = 3653;
myLog.WriteEntry("salut", EventLogEntryType.Information,
eventId);
this.projGuid = (Guid)e.ProjectGuid;
this.projectDS =
this.projwsprop.ReadProject(this.projGuid,
wsproject7.DataStoreEnum.PublishedStore);
myLog.WriteEntry("salut go fin",
EventLogEntryType.Information, eventId);
}

}
}


Event Type: Error
Event Source: Office SharePoint Server
Event Category: Project Server Server-Side Events
Event ID: 6663
Date: 16/05/2007
Time: 17:22:26
User: N/A
Computer: GNB500149
Description:
Event Handler \ClassLibrary3.Class1\ threw an exception: 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 ClassLibrary3.wsproject7.Project.ReadProject(Guid projectUid,
DataStoreEnum dataStore)
at ClassLibrary3.Class1.OnPublished(PSContextInfo contextInfo,
ProjectPostPublishEventArgs e)

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top