0

I have a workflow defined on the Workflow Tasks list and I have a simple REST call to that same list and then I repeat the exact same REST call to that list and the first one works like a charm, the second one does not. It Hangs and the error seems to imply the results are coming back via XML and not JSON. Though the Dictionary, I've defined have the following structure,

Accept String application/json;odata=verbose

Content-Type String application/json;odata=verbose

My original code actually had the second REST Call to a different List, but to debug, simplify, I used an exact copy. I even put it into a different Stage to see if that made a difference. I even used the exact same variables for the Call and tried using completely different variables.

What is going on here? Why is the second call which now is exactly coded as the first call returning as XML. The message I get while it is hung up is:

RequestorId: 65d32ce8-525e-74ba-0000-000000000000. 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/atom+xml'. Content (truncated) : 'fd1431e7-4227-46b2-afcf-2f025ef99f7a2019-05-21T16:07:30Z'. ResponseStatusCode : 'OK' Request Uri : 'https://xxx/hc/teams/MES//_api/lists/GetByTitle('Workflow Tasks')/Items?$select=Title&$filter=(Project_x0020_ID eq 'Sample1 23') and (TaskUID eq '0') and (PercentComplete ne 1)' at Microsoft.Activities.Messaging.SendHttpRequest.OnReceiveResponse(NativeActivityContext context, Bookmark bookmark, Object value) at System.Activities.Runtime.BookmarkWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Thank you

4
  • By chance have you taken a look at this article? sharepoint.stackexchange.com/questions/135749/… . Not sure if it will help but worth a shot. Commented May 22, 2019 at 15:34
  • The reference is to use the Accept and Content-Type. I am using that as I have indicated. The other issue is that I have the same call twice. The first one works but not the second one. They are coded identically. Commented May 22, 2019 at 15:50
  • Ok, I created a new workflow with a single call and I get the same problem. I defined my Dictionary as: Accept and Content-Type of type String, values=application/json;odata=verbose. Then I add the call String=[%Workflow Context:Current Site URL%]/_api/lists/GetByTitle('EmailSetup')/Items?$select=Title RequestType=HTTP Get RequestHeaders: requestHeaders (dictionary) RequestContent: RequestContent (dictionary) ResponseContent: ResponseContent (dictionary) ResponseHeaders: ResponseHeaders (dictionary) ResponseStatusCode: ResponseCode (String) Commented May 24, 2019 at 15:10
  • Dis-regard that last comment. The request Header was not setup correctly. But I still have the issue, with two of the calls. Commented May 24, 2019 at 15:43

1 Answer 1

0

Ok, it all comes down to the fact that I had the wrong variable as defined by the Call, The requestHeader was not in the appropriate place. My bad. I apologize to all who have wasted their time on this.

1
  • It happens. I usually spend more time debugging some silly logic error than anything else. Glad you figured it out. Commented May 25, 2019 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.