I have a PHP client that has to query datasets from a service that uses .NET. So, I was trying to make a query by passing a POST field called 'query'. Inside this variable, I have a string version of XML document. What's happening now is that whenever I passed this 'query' to the server, it will throw an exception at me 'Data at the root level is invalid.' and point to the last line of my XML document.
Any tips?
Here's the XML
<?xml version="1.0" encoding="utf-8"?>
<Predicate>
<ComparisonPredicate name="like" isEnabled="True" id="" DistinctIndividualQueries="False">
<FacetOperand reference="TriggeredAlerts.Alert.Name"/>
<Comparison operation="like"/>
<ValueOperand type="System.String" value="Sample"/>
</ComparisonPredicate>
</Predicate>
Here's the var_dump()
string(335) "<?xml version="1.0" encoding="utf-8"?>
<Predicate>
<ComparisonPredicate name="like" isEnabled="True" id="" DistinctIndividualQueries="False">
<FacetOperand reference="TriggeredAlerts.Alert.Name"/>
<Comparison operation="like"/>
<ValueOperand type="System.String" value="TestAlert"/>
</ComparisonPredicate>
</Predicate>
"