Title / Description
Code package com.kcc.tempos.parsers { import mx.resources.ResourceManager; /** * Error de la query view data. * Este muchacho sabe ademas como parsear la informacion extra que arroja el QVD webservice. */ public class QVDParserError extends WorkSheetError { public function QVDParserError(message:String = "", id:int = 0) { super(message, id); } /** * Parseo el error y obtengo los valores desde el XML. * Generalmente el objecto es de la forma: * * <soap-env:Fault> * <faultcode>soap-env:Client</faultcode> * <faultstring xml:lang="en">NoApplicableData</faultstring> * <detail> * <n0:GetQueryViewData.Exception xmlns:n0="urn:sap-com:document:sap:soap:functions:mc-style"> * <Name>NoApplicableData</Name> * <Text>Message not found (in main memory)</Text> * <Message> * <ID>BL</ID> * <Number>209</Number> * </Message> * </n0:GetQueryViewData.Exception> * </detail> * </soap-env:Fault> * * @param obj */ override public function fromXML(obj:Object):void { if (obj == null) return; this.obj = obj; var localName:String = (this.obj is XML) ? (this.obj as XML).localName().toString() : ""; switch (localName) { case "Fault": this.sysubrc = 0; this.sylangu = "E"; var details:XML = obj.*[2].*[0]; if (details.Name.toString() == "NoApplicableData") { this.exception = "no_applicable_data"; this.message = ResourceManager.getInstance().getString('error', 'error.' + this.exception) + " " + details.Text.toString(); } else { this.message = details.Text.toString(); } break; } if (message == "") { message = this.exception + this.sylangu; } } } }
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code