如何使用 Workflow Foundation 从 Sharepoint 文档库下载文档?
我在 Documents 文件夹下的 TFS2010 源代码管理中有一些测试、安全、项目管理和其他一些 Word 文档。有谁知道如何访问它们以便下载并复制到本地路径?
这些文件实际上并不位于 $/... 文件夹下,尽管它们具有 Sharepoint Web 服务器路径,例如:“http://myServer/sites/MyProyect/Test/Tests_P13_F00120.doc
”。我尝试使用 DownloadFiles
活动但没有成功,因为它需要一个以 $/ 开头的路径。请问有什么建议吗?
I have some Test, Security, Project Management and some other word documents in TFS2010 source control under Documents folder. Does anybody know how to access them in order to download and copy to a local path?
Those files are not physically under $/... folder, though they have a Sharepoint web server path like: "http://myServer/sites/MyProyect/Test/Tests_P13_F00120.doc
". I have tried to use DownloadFiles
activity without success due to it needs a path which starts with $/. Any suggestion please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
DownloadFiles
不是您可以使用的活动,它旨在处理驻留在源代码管理中的文件。相反,您需要建立与 TFS 的 Sharepoint Copy 服务的连接,该服务位于
http:///_vti_bin/Copy.asmx
。我们通过在构建解决方案中添加服务引用来做到这一点。然后,我们实现了一个构建活动,该活动基本上与您所追求的相反:在 TFS 构建期间,它将文档上传到 Sharepoint。
实例化如下所示:
此复制服务公开一个
GetItem
方法,您可能应该调用该方法。我不知道这个 GetItem 是否能够支持 http://myServer/sites/MyProject/Test/*.doc 之类的东西
DownloadFiles
is not an activity you can make use of, it's meant to deal with files residing in Source control.Instead, you need to establish a connection to the Sharepoint Copy service of your TFS, which resides at
http://<Site>/_vti_bin/Copy.asmx
. We did this by adding a Service Reference in our build solution.We then implemented a build activity that does basically the opposite of what you are after: during TFS build it uploads documents into Sharepoint.
The instantiation looks like this:
This copy service exposes a
GetItem
method, this is the one you should probably be invoking.I 'm not aware if this
GetItem
is capable of supporting ahttp://myServer/sites/MyProject/Test/*.doc
kind of thing