Hi Thanks for the reply...The issue was sorted by creating a geometry service on the ArcGIS Server.
But still the question remains to me... When i run the application from another system other than server, it throws the exception but when the deploy the application to the IIS server on the ArcGIS server machine, it works fine without any problem.
my question is , if the ArcGIS server and IIS server are on different machines as is the case when i am running application from my local machine, then how do we make the application run without throwing that exception...