none
Unable to deserialize HTTP response content - SharePoint Designer Call Web Service Workflow Activity

    Question

  • I am calling file REST API file method "GetFileByServerRelativeURL('Server Relative URL')/$value' to get the file contents (media resource)  using 'Call HTTP Web Service Action' in SharePoint 2013 workflow. When i try to execute this call, workflow gives me the following error and gets suspended:

    Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.IO.InvalidDataException: Unable to deserialize HTTP response content. Expected ContentType : 'application/json', 'text/plain' or 'text/html', Received ContentType : 'application/octet-stream'.

    I have set following properties in request headers for this web service call:

    1) accept : application/json; odata=verbose

    2) content-type: application/json; odata=verbose

    3) binaryStringResponseBody: true

    I presume the call works because it is returning the binary stream, i want this file binary stream so that i can copy this file to another team site. I am following this article but i need to use workflow to achieve this. Guidance needed!



    Saturday, July 16, 2016 11:29 PM

All replies

  • I'm having the same issue
    Thursday, July 21, 2016 11:53 PM
  • Hi,

     

    We are currently looking into this issue and will give you an update as soon as possible.

     

    Best Regards,

     

    Dean Wang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Thursday, July 28, 2016 6:27 AM
    Moderator
  • We were able to resolve by adding another string parameter to the request header called "Authorization" and left the value blank.
    Thursday, July 28, 2016 1:56 PM
  • Hi,

     

    We are currently looking into this issue and will give you an update as soon as possible.

     

    Best Regards,

     

    Dean Wang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Hi Dean,

    Any update on this?

    Bilal

    Tuesday, March 7, 2017 2:14 PM
  • same problem here.

    Trying to fetch any attachment via visual studio in SharePoint 2013 workflow and copy to subsite via REST POST.

    Copying Response String received as payload for POST does result in incorrect file.

    Saturday, December 9, 2017 3:46 PM
  • Same issues for me.

    Team Microsoft - Any update for the resolution ?

    Wednesday, January 10, 2018 3:52 PM
  • Was someone able to resolve the issue. I still get the same error - 

    Unable to deserialize HTTP response content. Expected ContentType : 'application/json', 'text/plain' or 'text/html', 
    Received ContentType : 'application/octet-stream'. 

    Wednesday, January 17, 2018 6:56 PM
  • I have the same issue when I try to nest two 'Call HTTP Web Service' actions, one inside another in a loop. This error appears in the nested 'Call HTTP Web Service' action executed.  In my case, I try to list master-detail records from two lists.
    Friday, August 17, 2018 4:55 PM