Hi,
It worked! Using the sde.st_intersects inside the query solved the problem.
In my opinion, there is a bug in 3.7 api (and maybe in earlier versions)when the polygon is used as a filter in a query. The extra double quotes generated by the api cause the error in Arcgis Sever 10.1 sp1, even with simple polygons. In 10.2(I've used the arcgis online servers), it works with both formats(with ou without the extra double quotes).
Anyway, I'd like to say thank you so much for your help, jgravois!