Link Existing Workspace with a Project using PSI

K

Kit

Problem: I have a lot of migrated sites that need to be linked to their
corresponding project using a console app.

Essentially, it would be the same that is happening here:
http://Server/ProjectServer/_layouts/PWA/Admin/ManageWSS.aspx
(Clicking a project, click edit, and then filling in the existing site
url... but doing this hundreds of times is simply not going to work)

First I tried simply calling update.
ProjectWebSvc.UpdateProjectWorkspaceAddress(projectUid, siteUrl, wssUid);
However, this doesn't work if the project doesn't have a workspace created
for it already.

Then I thought that I could simply add a row to:
ProjectWSSInfoDataSet.ProjWssInfoDataTable
But I couldn't find any sort of "Update" method that would send those
changes back to the server.

Any help is much appreciated,
Kit

P.S. I have already looked at "How to: Create a Project Workspace and Link
it to a Project" (http://msdn2.microsoft.com/en-us/library/aa568778.aspx) but
that CREATES a site. I simply need to link the site to the project.
 
K

Kit

I would like to add:

Calling WssInteropWebSvc.CreateWssSite(...) gives me the WSSWebAlreadyExists
error.

Calling UpdateProjectWorkspaceAddress(...) gives me the WSSWebDoesNotExist.

Both calls use the same URL!
 
K

Kit

Fixed it!

These two calls DO NOT use the same URL. CreateWssSite() takes the full url
while UpdateProjectWorkspaceAddress() takes the relative url.
Ex:
"http://server/something/Project Name" for CreateWssSite()
vs
"something/Project Name" for UpdateProjectWorkspaceAddress()
 

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