尝试从sharepoint服务器检索文件时出错 [英] Error while trying to retrieve the files from sharepoint server
问题描述
您好,
我刚开始学习Sharepoint集成。我在调用时使用以下URL来查看sharepoint文件
https://< siteurl> / _api / web / getFolderByServerRelativeUrl('/ Folder Name')/ files
不幸的是,http调用低于错误
消息:此系统的外部服务器[key = sharepoint]在调用函数时生成异常[ shpInvoke。来自外部系统的详细信息:java.lang.IllegalArgumentException:com.fasterxml.jackson.core.JsonParseException:意外字符
('<'(代码60)):预期有效值(数字,字符串,数组,对象) ,'true','false'或'null')
我无法理解为什么在没有传递任何字符串/字符时它会说出意外的字符。有人知道这个错误吗?
对于SharePoint Rest API getFolderByServerRelativeUrl端点,它需要传递相对url的文件夹。例如,如果完整的文档库文件夹URL如下所示:
http:// sp2016 / sites / test / Documents1 / folder2
这是名为"folder2"的文件夹在名为"Documents1"的库中然后Rest API会这样:
http:// sp2016 / sites / test / _api / web / getFolderByServerRelativeUrl('/ sites / test / Documents1 / folder2')/ files
参考:
在一个REST中的ServerRelativeUrl中获取所有SharePoint文档库文件和文件夹调用
似乎你从Java应用程序调用Rest,你可以引用这个也从Java调用Rest的演示:
谢谢
Hello ,
I just started learning Sharepoint integration. I am using the below URL at the invocation to view the sharepoint files
https://<siteurl>/_api/web/getFolderByServerRelativeUrl('/Folder Name')/files
Unfortunately the http call is throwing below error
message:The external server for this system [key=sharepoint] generated an exception when calling a function [shpInvoke]. Details from external system: java.lang.IllegalArgumentException: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
I couldn't understand why does it say Unexpected character while am not passing any string/characters. Does someone has any idea of this error?
Hi,
For SharePoint Rest API getFolderByServerRelativeUrl endpoint, it needs to pass the folder relative url. For example, if the complete document library folder url like this:
http://sp2016/sites/test/Documents1/folder2
This is a folder named "folder2" in the library named "Documents1" and then the Rest API will like this:
http://sp2016/sites/test/_api/web/getFolderByServerRelativeUrl('/sites/test/Documents1/folder2')/files
Reference:
Get all SharePoint Document Library Files and Folders at a ServerRelativeUrl in One REST Call
And seems you are calling the Rest from Java Application, you could reference this demo which also call Rest from Java:
Get a document from a Sharepoint library
Thanks
这篇关于尝试从sharepoint服务器检索文件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!