0

I am developing a Windows application that will allow SharePoint administrators to copy a content type from one server to another (across two SharePoint environments). I am at a point where I have the content type information that I want to copy. However, I am not being able to connect to the destination server. I get a "FileNotFound" exception when I try to create a SPSite object using the destination site URL; my code base is on the source server.

My question: Does the SharePoint object model support connecting to a remote server? If not, can I create a content type object in the remote server using SharePoint web services? If not, is there any other alternative API (other than creating my own web service) to achieve this goal?

Thank you for you help in advance!

4

2 回答 2

1

在谈论 SharePoint 2010 时,您应该看看内容类型中心。通过使用内容类型中心,您可以使用元数据服务应用程序在 SharePoint SiteCollections 和 Web 应用程序之间轻松共享 ContentType。

因此,您不必手动复制内容类型。

于 2012-10-16T22:04:09.363 回答
0

要回答您的第一个问题,不,服务器对象模型只能针对本地环境使用。

Webs Web 服务 ( http://msdn.microsoft.com/en-us/library/webs.webs_methods(v=office.12).aspx ) 具有创建/删除/更新内容类型的规定。

但请记住,理论上,内容类型可能取决于外部因素,如工作流、事件接收器、InfoPath 表单、解决方案等,这些外部因素将更难/不可能通过 OOTB Web 服务复制到新环境。

于 2011-07-29T00:13:23.740 回答