When issuing a query that joins 2 tables and selects columns from both, and using RETURN XML AUTO, I get this error in our app as well as SWQL studio: More than one root element in the generated schema - [status,definitions]
Here is an example query that causes this:
SELECT TOP 10 status.AlertDefID AS AlertID, definitions.Name as AlertDef FROM Orion.AlertStatus status LEFT JOIN Orion.AlertDefinitions definitions ON definitions.AlertDefID = status.AlertDefID ORDER BY TriggerTimeStamp DESC RETURN XML AUTO
Using RETURN XML RAW works but it names the XML elements as c0, c1 which is a bit inconvenient when parsing out the data. Any tips on fixing this or a better approach?
- <s:Fault xmlns:s="http://www.w3.org/2003/05/soap-envelope">
- <s:Code>
<s:Value>s:Receiver</s:Value>
- <s:Subcode>
<s:Value xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</s:Value>
</s:Subcode>
</s:Code>
- <s:Reason>
<s:Text xml:lang="">More than one root element in the generated schema - [status,definitions]</s:Text>
</s:Reason>
- <s:Detail>
- <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<HelpLink i:nil="true" />
<InnerException i:nil="true" />
<Message>More than one root element in the generated schema - [status,definitions]</Message>
<StackTrace>at SolarWinds.InformationService.Serialization.XmlResponseSerializerAutoStrict.MakeSchema(IEnumerable`1 columnsMetadata) at SolarWinds.InformationService.Serialization.XmlResponseSerializerAutoStrict.EmitHierarchicalSchema(XmlWriter writer, IEnumerable`1 columnsMetadata) at SolarWinds.InformationService.Serialization.XmlResponseSerializerAutoStrict.Serialize(XmlWriter writer) at SolarWinds.InformationService.Serialization.XmlSerializer.Serializable.WriteXml(XmlWriter writer) at SolarWinds.InformationService.Serialization.BufferedSerializable.InitializeXml() at SolarWinds.InformationService.Core.InformationService.Query(String queryString, SafePropertyBag parameters, IMessageFormatterStrategy messageFormatterStrategy) at SyncInvokeQuery(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace>
<Type>System.InvalidOperationException</Type>
</ExceptionDetail>
</s:Detail>
</s:Fault>
Thanks