Hello Team,
I tried to do save operation in the project server using the sample provided here.
private static void SaveProjectToServerAspose(string sPath)
{
//Scenario 1
var windowsCredentials = new NetworkCredential(USERNAME, PASSWORD, DOMAIN);
var credentials = new ProjectServerCredentials("http://MSSERV16/sites/PWA", windowsCredentials);
ProjectServerManager manager = new ProjectServerManager(credentials);
var project = new Project(@"Sample1.mpp");
manager.CreateNewProject(project);
//Scenario 2
windowsCredentials = new NetworkCredential(USERNAME, PASSWORD, DOMAIN);
credentials = new ProjectServerCredentials("http://MSSERV16/sites/PWA", windowsCredentials);
manager = new ProjectServerManager(credentials);
project = new Project(@"Sample2.mpp");
manager.CreateNewProject(project);
//Scenario 3
credentials = new ProjectServerCredentials("http://MSSERV16/sites/PWA", USERNAMEREADER, USEREADERPASSWORD);
manager = new ProjectServerManager(credentials);
project = new Project(@"Sample1.mpp");
manager.CreateNewProject(project);
}
For the mentioned three scenarios am getting different exceptions.
Scenario 1:
Aspose.Tasks.ProjectOnlineException
HResult=0x80131600
Message=Cannot connect to the Project Online. See inner exception for more details.
Source=Aspose.Tasks
StackTrace:
at #=zuF8ehdzVUJ4G8xlzM3tF5Zo2lGSaphfF3g==.#=z5FYbijI8gNOL(String #=zZFAqDlQ=, String #=zMEgpLoE=, String #=zexqCTFw=)
at #=zXyabF7CoNzVz6lVErx1WUsnW$jCsqnIct$ytnHc=.#=zDSbkA8X4p2RF(Boolean #=zgclonkU=, Boolean #=z3H4UBRI=, String #=zQkoQ_dsZOK3w)
at #=z6zZu2JkyT55GrZ9H5fBlY8tnEzqOHvuCjQu0Iti0t23w.#=zZBxRvmQ=(Project #=znsUTsbo=, ProjectServerSaveOptions #=zWgDWmdg3dgl5, Boolean #=zgclonkU=)
at Aspose.Tasks.ProjectServerManager.CreateNewProject(Project project, ProjectServerSaveOptions saveOptions)
at Aspose.Tasks.ProjectServerManager.CreateNewProject(Project project)
This exception was originally thrown at this call stack:
System.Net.HttpWebRequest.GetResponse()
#=zE46bfZmvpKnijLiYY0AAbKocGHyoEBSZIKMeH$s=.#=zQSIlulU=(System.Net.HttpWebRequest)
#=zuF8ehdzVUJ4G8xlzM3tF5Zo2lGSaphfF3g==.#=z5FYbijI8gNOL(string, string, string)
Inner Exception 1:
WebException: The remote server returned an error: (500) Internal Server Error.
Scenario 2:
System.ArgumentException
HResult=0x80070057
Message=project’s calendar guid should be set to non-empty value.
Source=Aspose.Tasks
StackTrace:
at #=zMR24he8ySJEObbI36QfmsTpnd723$4RminbtMB3Hp$XyT2JDEg==.#=za448GVAl1mwg(Project #=znsUTsbo=, List1 #=zawDCs54=) at #=zf_T$Y76Xd4sI$QzVEZVKYfClkXTr0HmcS4R7_UkXD$6iHTTJmg==.#=z6agrBO9Ts4O5(List
1 #=zawDCs54=, Project #=zHCiGwwyy9zdo)
at #=zSx8TnyhXMgVX1KTWOqlWEzLEctBwEUi$tT_xuXZpnKm8Pznk$x6YO8I=.#=zqCBUx0wuhF46(#=zOtGIpuE= #=zHCiGwwyy9zdo, List`1 #=zawDCs54=)
at #=zzVS8yBtsdwvqMS5_nJYXPTCK1JJ9REmSQZVmK65qYIDG.#=zjMGIYHEKWAPQ(Project #=znsUTsbo=, MemoryStream #=zX3IrgNE=)
at #=z6zZu2JkyT55GrZ9H5fBlY8tnEzqOHvuCjQu0Iti0t23w.#=zZBxRvmQ=(Project #=znsUTsbo=, ProjectServerSaveOptions #=zWgDWmdg3dgl5, Boolean #=zgclonkU=)
at Aspose.Tasks.ProjectServerManager.CreateNewProject(Project project, ProjectServerSaveOptions saveOptions)
at Aspose.Tasks.ProjectServerManager.CreateNewProject(Project project)
Scenario 3:
Aspose.Tasks.ProjectOnlineException
HResult=0x80131600
Message=Failed to retrieve auth token. Unexpected structure of security token response.
Source=Aspose.Tasks
StackTrace:
at #=zuF8ehdzVUJ4G8xlzM3tF5Zo2lGSaphfF3g==.#=zBpjhsDYzDSF9(Stream #=zyeWM52vUIqUG)
at #=zuF8ehdzVUJ4G8xlzM3tF5Zo2lGSaphfF3g==.#=z$JAO8dFdp6ig(String #=zW5sYzFifgNVRmhGyhbj4r_4=, String #=zKZMO7WQ=, String #=zuM6vyp0=)
at #=zuF8ehdzVUJ4G8xlzM3tF5Zo2lGSaphfF3g==…ctor(ProjectServerCredentials #=zR6G82ts=, #=zvuCj04bqpFeJ7ROPH3tvYXZHiLmXI9hR5uOoOvE= #=zmgRd36kAz1uC)
at #=zuF8ehdzVUJ4G8xlzM3tF5Zo2lGSaphfF3g==…ctor(ProjectServerCredentials #=zR6G82ts=)
at Aspose.Tasks.ProjectServerManager…ctor(ProjectServerCredentials credentials)
For Scenario 1 & 2 I tried to use domain login credentials with two different mpp files which was created locally using Aspose.Task, when trying to upload the files the exceptions were coming up.
For Scenario 3, I am trying to use the user which was specifically created in MPP Server 2016 for performing project read/create operations, for which I was getting security token exception.
Can you please cross check these behavior and direct me on how to proceed using this feature.
Sample project files attached here.
Thank you.