I think we have found a bug in the Exo API Search Template endpoint, when the SQL query in the template returns only 1 row. Testing the same query but changing a parameter so it returns zero rows or 2+ rows works fine. We have tested this with different search templates and getting the same result each time.
In Postman, we get a 200 OK response, but the body of the response is blank.
Using the exact same request in Advanced REST Client, we get a 500 Internal Server Error response, with the following entry in the error log file:
2022-04-06 14:59:04.2509:P [1]:39:ERROR:Error processing request on internal HttpServer
EXCEPTION: System.InvalidOperationException: Duplicate attribute.
at System.Xml.Linq.XElement.AddAttributeSkipNotify(XAttribute a)
at Newtonsoft.Json.Converters.XElementWrapper.SetAttributeNode(IXmlNode attribute)
at Newtonsoft.Json.Converters.XmlNodeConverter.AddJsonArrayAttribute(IXmlElement element, IXmlDocument document)
at Newtonsoft.Json.Converters.XmlNodeConverter.DeserializeNode(JsonReader reader, IXmlDocument document, XmlNamespaceManager manager, IXmlNode currentNode)
at Newtonsoft.Json.Converters.XmlNodeConverter.CreateElement(JsonReader reader, IXmlDocument document, IXmlNode currentNode, String elementName, XmlNamespaceManager manager, String elementPrefix, Dictionary`2 attributeNameValues)
at Newtonsoft.Json.Converters.XmlNodeConverter.ReadElement(JsonReader reader, IXmlDocument document, IXmlNode currentNode, String propertyName, XmlNamespaceManager manager)
at Newtonsoft.Json.Converters.XmlNodeConverter.DeserializeNode(JsonReader reader, IXmlDocument document, XmlNamespaceManager manager, IXmlNode currentNode)
at Newtonsoft.Json.Converters.XmlNodeConverter.CreateElement(JsonReader reader, IXmlDocument document, IXmlNode currentNode, String elementName, XmlNamespaceManager manager, String elementPrefix, Dictionary`2 attributeNameValues)
at Newtonsoft.Json.Converters.XmlNodeConverter.ReadElement(JsonReader reader, IXmlDocument document, IXmlNode currentNode, String propertyName, XmlNamespaceManager manager)
at Newtonsoft.Json.Converters.XmlNodeConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeXNode(String value, String deserializeRootElementName, Boolean writeArrayAttribute, Boolean encodeSpecialCharacters)
at MYOB.ED.EXO.Cloud.API.WebAPI.Formatters.DynamicXmlFormatter.JsonToXml(String json, Type rootType)
at MYOB.ED.EXO.Cloud.API.WebAPI.Formatters.DynamicXmlFormatter.<>c__DisplayClass6_0.<WriteToStreamAsync>b__0()
at System.Threading.Tasks.Task.Execute()
Using Business Services 1.6 with Exo 2017.3.