I'm developing a client application with ESRI WPF API (2.4). At some point, I perform an identify task in which I pass a polygon as argument. I realized that the features that were returned to me were not those that were intersecting the geometry of the polygon but those intersecting its envelope (I tried switching to a query task so as not to be bothered by extent, size and resolution issues but with similar results).
After some testing, I realized that this behavior is dependent on which data I put in the map service that I query, so I guess the problem is definitively server side.
At first I thought that it is some kind of coordinate system mismatch triggering what I believe to be a fall back to a default behavior, but so far I was unable to nail down the exact issue.
All my layers are query layers from an oracle database with SDO_GEOMETRY. I specified the same projection for all of them (Belgian Lambert 72) as well as for the data frame and I checked that the geometry columns were registered with that same coordinate system in the USER_SDO_GEOM_METADATA of the database.
I got a response from ESRI support. This issue is a bug and it persist in version 10.2. Not the response I was hoping for... So I guess Juliens workaround is the best option right now. In my case, there are not that many layers in from Oracle that needs this functionality so I might make some script to export them daily to a file geodatabase or shapefiles.