Hello!
I am trying to create an EventHandler which is running while/before publishing a project to check certain values in the project plan (e.g. task names, start dates, end dates).
public class DurationEventHandler : ProjectEventReceiver { private const string PROJECT_SERVER_URI = "http://wegsfes19822:8080/ProjectServer/_vti_bin/PSI/"; private const string PROJECT_WEBSERVICE = "project.asmx"; ... Project.ProjectDataSet dsProject = new Project.ProjectDataSet(); dsProject = project.ReadProject(e.ProjectGuid, Project.DataStoreEnum.WorkingStore); ... for (int t = 0; t < dsProject.Task.Count; t++) { Project.ProjectDataSet.TaskRow taskRow = dsProject.Task[t]; ... } }
I have added the Project Web reference, but while publishing a plan, we are always receiving 3 error message.
Event Handler for event \ProjectPublishing\ of type \DurationEventHandler.DurationEventHandler\ 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 DurationEventHandler.Project.Project.ReadProject(Guid projectUid, DataStoreEnum dataStore)
at DurationEventHandler.DurationEventHandler.OnPublishing(PSContextInfo contextInfo, ProjectPrePublishEventArgs e)
Soap error: Unspecified client error..
Soap error: Restoring data into SoapMapper GetWSSVServerURLResult failed.
What is going wrong? How can I check project plan details (tasks, assignments) during the save/publish of a project?
Many thanks for your help.
Joerg