I am trying to apply a filter to a soap call to get some data from a data extension below is the example soap body.
<soapenv:Body>
<par:RetrieveRequestMsg>
<par:RetrieveRequest>
<par:ObjectType>DataExtension</par:ObjectType>
<par:Properties>Name</par:Properties>
<par:Filter>
<par:FilterPart>
<par:Property>Name</par:Property>
<par:SimpleOperator>equals</par:SimpleOperator>
<par:Value>TEST</par:Value>
</par:FilterPart>
</par:Filter>
</par:RetrieveRequest>
</par:RetrieveRequestMsg>
</soapenv:Body>
As you can see from this fragment i am trying getting the name of the data extensions where the name equals to TEST, this doesn't work i get the error message Error: Incorrect syntax near the keyword 'ORDER'
.
Perhaps i have not applied the filter correctly? If so does anybody know the correct way of applying this filter onto the soap call?
I also tried the following
<par:Filter>
<par:Property>Name</par:Property>
<par:SimpleOperator>equals</par:SimpleOperator>
<par:Value>TEST</par:Value>
</par:Filter>
Same error. Removing the filter works and gets all the data extensions for my account.
EDIT:
Full soap envelope with suggested changes
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:par="http://exacttarget.com/wsdl/partnerAPI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="testuser" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>username</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<par:RetrieveRequestMsg>
<par:RetrieveRequest >
<par:ObjectType>DataExtension</par:ObjectType>
<par:Properties>Name</par:Properties>
<par:Filter xsi:type="SimpleFilterPart">
<par:Property>Name</par:Property>
<par:SimpleOperator>equals</par:SimpleOperator>
<par:Value>TEST</par:Value>
</par:Filter>
</par:RetrieveRequest>
</par:RetrieveRequestMsg>
</soapenv:Body>
</soapenv:Envelope>