如何从共享点文档库使用curl签出文件?

编程入门 行业动态 更新时间:2024-10-25 22:34:31
本文介绍了如何从共享点文档库使用curl签出文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

可以使用curl使用以下命令将文件签入到共享点文档库:这个问题:

It is possible to checkin a file to sharepoint document library using curl with the following command as mentioned in this question :

curl --ntlm --user username:password --upload-file file.txt mysharepointserver/sites/mysite/myfile.txt -k

但是如何从文档库首先检出文件(使用curl)?

But how to checkout the file first(using curl) from the document library?

我通过传递SOAPAction checkoutfile头和数据,尝试了一个方法,但是它没有任何效果,即使服务器返回了响应:'200 OK'

I tried one method by passing SOAPAction checkoutfile headers and data as follows, but it had no effect eventhough the server returned response: '200 OK'

curl --ntlm --user username:password -d @soapdata.xml -H "SOAPAction: schemas.microsoft/sharepoint/soap/CheckOutFile" -H "Content-Type: text/xml; charset=utf-8" mysharepointserver/sites/mysite/myfile.txt -k

soapdata.xml包含WSDL所描述的检出所需的SOAP数据。上面的命令有什么问题,或者有一个更简单的方法来做这个CURL像检查case?

soapdata.xml contains the SOAP data needed for checkout as described by WSDL. Is there something wrong in above command or is there a simpler way to do this with CURL like the checkin case?

推荐答案

示例,使用SOAP方法,CURL命令中的URL应该是共享点站点Lists.asmx的路径,而不是要检出的文件的URL。文件URL只需要在soapdata xml的pageUrl字段中,如下所示:

Found from an example that, with SOAP approach, the URL in CURL command should be the path of the sharepoint site Lists.asmx and not the URL of file to be checked out. The file URL need to be only in the pageUrl field in soapdata xml as follows:

curl --ntlm --user username:password -d @soapdata.xml -H "SOAPAction: schemas.microsoft/sharepoint/soap/CheckOutFile" -H "Content-Type: text/xml; charset=utf-8" -k -v mysharepointserver/sites/mysite/_vti_bin/Lists.asmx

其中soapdata的内容。 xml:

where contents of soapdata.xml:

<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="schemas.xmlsoap/soap/envelope/" xmlns:xsi="www.w3/2001/XMLSchema-instance" xmlns:xsd="www.w3/2001/XMLSchema"> <soap:Body> <CheckOutFile xmlns="schemas.microsoft/sharepoint/soap/"> <pageUrl>mysharepointserver/sites/mysite/myfile.txt</pageUrl> <checkoutToLocal>true</checkoutToLocal> <lastmodified/> </CheckOutFile> </soap:Body> </soap:Envelope>

更多推荐

如何从共享点文档库使用curl签出文件?

本文发布于:2023-11-28 15:46:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1643013.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文档   文件   curl

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!