Web request response stored as JSON instead of XML

  • 8 April 2016
  • 2 replies
  • 58 views

Badge +6

Hello,

I'm using Nintex Workflow for Sharepoint 2013, and I have a WebAPI service that returns XML values.

I call this service via the Nintex workflow's Web Request and store the variable in a text field, but when I print it in the log I see that it is stored as JSON (instead of the expected XML), and therefore I cannot parse it using XPATH!

Is there a way I can modify the behavior of the Web Request, to return XML instead of JSON?


2 replies

Userlevel 6
Badge +16

Have you tested it with the Run Now button?

Badge +6

Hey Fernando,

Thanks for the reply, I was able to solve the problem by adding an Accept Header with the value 'application/xml'.

The problem now is that I'm trying to retrieve an XML value stored WITHIN the returned XML, but all special characters are automatically encoded, i.e. the '<' is encoded to &lt; and the '>' is encoded to &gt;

I was able to by-pass this by adding 2 regex actions within the workflow, but I'm curious if there's a way to PREVENT this automatic encoding... do you have any ideas?

Reply