I've been following the example given by Jian but am struggling to get it to work. The issue seems to be related to the spatial reference of the data that I'm using (British National Grid : WKID 27700) because the API throws a javascript error when trying to access info.valid[0] and info.valid[1]. These properties seem to come from an object returned by a call to _c.spatialReference._getInfo() where _c I believe is the map object.
The spatialReference._info array only has items for WGS_1984_Web_Mercator_Auxiliary_Sphere (WKID 3857), GCS_WGS_1984 (WKID 4326), WGS_1984_Web_Mercator_Auxiliary_Sphere (WKID 102100) and WGS_1984_Web_Mercator (WKID 102113).
So the way to fix it seems to be to get an item for British National Grid into that array .. does anyone have any ideas as to what I would need to do to achieve that?
EDIT: For extra info, I'm running ArcGIS Server 9.3.1 and using javascript API version 2.3.