Geeks With Blogs
CMD Programming with a sawzall

So, I am working on a Proof of Concept that integrates TFS 2008, Project Server 2007 and MOSS.

After I create a site based  upon a custom site template I then create a project using the PWA web services (UpdateProjectWorkspaceAddress).  The project is created but when I try and update the project workspace URL using the wssinterop web service it fails with a WSSWebIsNotProjectWorkspace error. 

The template has the correct features activated and if I manually (through the PWA Admin UI) set the project workspace to the same web it works. 

I don't know why it fails since everything looks good but I did discover a workaround after looking at it for many hours. 

Call the same method twice.  Catch the first error and ignore it.  On the second call it returns sucessfully and sure enough it does update the URL.

I figured I would share that and save someone a few hours of frustration.

Example ( string projectName, Guid projectId, projectSvc which is reference to the webservice: http://servername/pwa/_vti_bin/psi/Project.asmx are passed in )

 

private void SetWSSURL(string projectName, Guid projectId, PWA.Project projectSvc)
{

WssInterop.

#region

WssInterop wssInterOpSvc = new WssInterop.WssInterop();
wssInterOpSvc.Url =
http://servername/pwa/_vti_bin/psi/wssinterop.asmx;
wssInterOpSvc.Credentials = CredentialCache.DefaultCredentials; Get workspace info
// Get the admin settings necessary for site linkage
WssInterop.WssSettingsDataSet dsCurrentWssInfo = wssInterOpSvc.ReadWssSettings();
WssInterop.WssSettingsDataSet.WssAdminRow adminRow = dsCurrentWssInfo.WssAdmin[0];
Guid wssWebAppUid = adminRow.WADMIN_CURRENT_STS_SERVER_UID;

//I am not using the default site collection.  I am using the TFS one (Sites/)
//if (!adminRow.IsWADMIN_DEFAULT_SITE_COLLECTIONNull())
//{
//        siteCollection = adminRow.WADMIN_DEFAULT_SITE_COLLECTION;
//}
#endregion
#region
Change Workspace Address
//try it once and ignore the output -- always fails the first time.
try
{
     projectSvc.UpdateProjectWorkspaceAddress(projectId,
"Sites/" + projectName, wssWebAppUid);
}
catch{ }
//do it again and it works. Don't ask me it's microsofts interface.
projectSvc.UpdateProjectWorkspaceAddress(projectId, "Sites/" + ProjectName, wssWebAppUid);
#endregion

}

Posted on Monday, February 9, 2009 1:08 PM MOSS 2007 , Programming (General) , Project Server 2007 , PWA | Back to top


Comments on this post: UpdateProjectWorkspaceAddress fails with WSSWebIsNotProjectWorkspace error

# re: UpdateProjectWorkspaceAddress fails with WSSWebIsNotProjectWorkspace error
Requesting Gravatar...
Thanks for posting this. I can't say it worked exactly the same for me unfortunately. I did what you mentioned and call the method twice and it fails twice but somehow manages to link anyways (shows as linked in Server Settings -> Project Workspaces).
Left by Kit on Aug 19, 2009 9:47 AM

Your comment:
 (will show your gravatar)


Copyright © CMD | Powered by: GeeksWithBlogs.net