SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
Asked
Viewed
2k times
Following problem with using ShP 2013 enterprise on premises and ShPDesigner2013:
- Given a site
http://server/site
which holds two document libraries
“docs1” and “docs2”. Both libraries hold *.docx documents. - The task: Create a ShPDesigner2013 workflow (for some reasons I can’t use Visual
Studio) which copies the selected document (current item
) from docs1
to docs2. - My problem: I have correctly built the request header
(Accept - String - application/json;odata=verbose
), but the “Call
http web service” action with method=POST and
http://server/site/_api/web/lists/GetFileByServerRelativeURL('/docs1/test.docx')/copyTo(strNewUrl='/server/site/docs2/test.docx',bOverwrite=true)
doesn’t work, it cancels with the following error message:
RequestorId: ad9824d3-039b-698e-615a-71e2f4b554df. Details: System.ApplicationException: HTTP 500 {“Transfer-Encoding”:(“chunked”),”X-SharePointHealthScore”:(“0″),”SPClientServiceRequestDuration”:(“54″),”SPRequestGuid”:(“45bc2344-b620-4a4a-850b-0d5476b09e4e”),”request-id”:(“45bc2344-b620-4a4a-850b-0d5476b09e4e”),”X-FRAME-OPTIONS”:(“SAMEORIGIN”),”MicrosoftSharePointTeamServices”:(“15.0.0.4841″),”X-Content-Type-Options”:(“nosniff”),”X-MS-InvokeApp”:(“1; RequireReadOnly”),”Cache-Control”:(“max-age=0, private”),”Date”:(“Tue, 26 Jun 2018 11:46:32 GMT”),”Server”:(“Microsoft-IIS/8.5″),”X-AspNet-Version”:(“4.0.30319″),”X-Powered-By”:(“ASP.NET”)} at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
What am I doing wrong?
Firstly, ensure the http://server/site/_api/web/lists/GetFileByServerRelativeURL('/docs1/test.docx')
call works because you’re not really giving it a server-relative url (/site/docs1/test.docx
in your example).
-> you can easily verify if the file was correctly referenced if it returns valid results in the browser or JSOM call.
Secondly, for strNewUrl also provide a server-relative url (/site/docs2/test.docx
) => your example had the hostname part “/server” included.
5
default
