import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; import mx.rpc.http.HTTPService; import com.esri.serialization.json.JSON; private var httpServ:HTTPService; httpServ2 = new HTTPService; httpServ2.url = "http://yourServer/arcgis/rest/services/yourService/mapserver/0?f=json"; httpServ2.addEventListener(ResultEvent.RESULT, xmlResult); httpServ2.addEventListener(FaultEvent.FAULT, xmlFault); httpServ2.send(); private function xmlResult(event:ResultEvent):void { var Info:Object = JSON.decode(event.result.toString()); var defExpr:String = Info.definitionExpression; } private function xmlFault(event:FaultEvent):void { var sInfo:String = "Error: "; sInfo += "Event Target: " + event.target + "\n\n"; sInfo += "Event Type: " + event.type + "\n\n"; sInfo += "Fault Code: " + event.fault.faultCode + "\n\n"; sInfo += "Fault Info: " + event.fault.faultString; trace(sInfo); }
private var httpServ2:HTTPService;
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.