Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.


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


Same error. Removing the filter works and gets all the data extensions for my account.


Full soap envelope with suggested changes

<soapenv:Envelope xmlns:soapenv="" xmlns:par="" xmlns:xsi=""> <soapenv:Header> <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse=""> <wsse:UsernameToken wsu:Id="testuser" xmlns:wsu=""> <wsse:Username>username</wsse:Username> <wsse:Password Type="">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>

share|improve this question
up vote 3 down vote accepted

The filter requires a type. Try it like this. Edit: Removed the namespaces and cleaned up the full packet below. Should work now.

<Filter xsi:type="SimpleFilterPart">
    <Value>CACI TEST</par:Value>

Be sure to include the following namespace


Full SOAP Envelope:

<soapenv:Envelope xmlns:soapenv="" xmlns:xsi="">
        <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="">
            <wsse:UsernameToken wsu:Id="testuser" xmlns:wsu="">
                <wsse:Password Type="">password</wsse:Password>
  <RetrieveRequestMsg xmlns="">
        <Filter xsi:type="SimpleFilterPart">
share|improve this answer
changed it and added the namespace, but now getting a different error Server was unable to read request. ---> There is an error in the XML document. ---> The specified type was not recognized: name='SimpleFilterPart', namespace='', at &lt;Filter xmlns=''>. any idea why this would be? – JCS Aug 19 '14 at 12:53
Can you post the full packet to your question? – Kelly J Andrews Aug 19 '14 at 12:54
added the full soap envelope request to my original post – JCS Aug 19 '14 at 12:59
Your full soap envelope worked for me thanks. – JCS Aug 19 '14 at 14:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.