While creating a com.esri.arcgisws.RectangleElement from com.esri.arcgis.carto.RectangleElement, the application is throwing the following exception: "Com.esri.adf.web.ags.ADFAGSException: Unable to create Stub from the ArcObject."
Below is a sample snippet to create com.esri.arcgisws.RectangleElement from com.esri.arcgis.geometry.IEnvelope. -----------------------------------------------Create IEnvelope content and use the below code to create RectangleElement.Com.esri.arcgisws.RectangleElement rectangleElement1 =new com.esri.arcgisws.RectangleElement ();EnvelopeN envelopeN = (EnvelopeN) AGSUtil.createStubFromArcObject (ienvelope, EnvelopeN.class, serverContext);rectangleElement1.setRectangle (envelopeN);----------------------------------------------