1

I am using primavera webservices (version 6.2.1) to read data from a primavera database (sqlserver 2008R2) in a winform application (c#). I use http cookie container authentication mode. Before I moved my database to a new server I was able to login and read data from the primavera database successfully but when I moved DB (using backup and restore), I can still login to db but primavera webservices return null for any request.

This is my code to login:

AuthenticationService authService = new AuthenticationService( );  
authService.CookieContainer = new System.Net.CookieContainer( );  
authService.Url = _P6wsAuthenticationService;  
Login loginObj = new Login( );  
loginObj.UserName = pv_Username;  
loginObj.Password = pv_Password;  
loginObj.DatabaseInstanceId = 1;  
loginObj.DatabaseInstanceIdSpecified = true;  
loginObj.VerboseFaults = true;  
loginObj.VerboseFaultsSpecified = true;  
LoginResponse loginReturn = authService.Login( loginObj );     
ReadDatabaseInstancesResponseDatabaseInstance[] readdbInstances = authService.ReadDatabaseInstances("");    
cookieContainer = authService.CookieContainer;

When I run this code the loginresponse for new database is "true" and it shows the correct database instance information in "readdbInstances".

I run the following code to read some project info from DB:

ProjectPortBinding pbProject = new ProjectPortBinding( );    
pbProject.CookieContainer = cookieContainer;  
pbProject.Url = _P6wsProjectService;     
ReadProjects readProject = new ReadProjects( );      
Primavera.Ws.P6.Project.ProjectFieldType[] pfProject = new Primavera.Ws.P6.Project.ProjectFieldType[6];     
pfProject[0] = Primavera.Ws.P6.Project.ProjectFieldType.ObjectId;  
pfProject[1] = Primavera.Ws.P6.Project.ProjectFieldType.Id;  
pfProject[2] = Primavera.Ws.P6.Project.ProjectFieldType.Name;  
pfProject[3] = Primavera.Ws.P6.Project.ProjectFieldType.Status;  
pfProject[4] = Primavera.Ws.P6.Project.ProjectFieldType.StartDate;  
pfProject[5] = Primavera.Ws.P6.Project.ProjectFieldType.FinishDate;     
readProject.Filter = pv_ProjectList.Equals( String.Empty ) ? String.Empty : "Id IN (" + pv_ProjectList + ")";  
readProject.Field = pfProject;     
Primavera.Ws.P6.Project.Project[] aProject = pbProject.ReadProjects( readProject );

it sends the request to the server but the message that I receive contains no project.

Before I moved the database I was able to read data with the same code. I changed database instance for primavera web services using its database configuration and I'm sure that it connects to the right DB, I'm just confusing why it cannot read the data from it. When I use the primavera client module to connect and read data from the new database it works fine and I can see all my projects.

lord.garbage
  • 5,884
  • 5
  • 36
  • 55
Ashrafi
  • 11
  • 4

1 Answers1

0

Check the credentials that you are using in the user administrator front end, you will need to increase the permissions there on a module level or project level. Once you enable those you should see some data.

Kindly, JK.

JayKayOf4
  • 1,202
  • 1
  • 12
  • 15