home *** CD-ROM | disk | FTP | other *** search
/ Computer Active 2010 August / CA08.iso / Darbas / kidoz_v1.air / kidoz.swf / scripts / mx / rpc / soap / SOAPDecoder.as < prev    next >
Encoding:
Text File  |  2009-05-06  |  23.9 KB  |  733 lines

  1. package mx.rpc.soap
  2. {
  3.    import flash.utils.getTimer;
  4.    import flash.xml.XMLDocument;
  5.    import flash.xml.XMLNode;
  6.    import mx.logging.ILogger;
  7.    import mx.logging.Log;
  8.    import mx.rpc.soap.types.ICustomSOAPType;
  9.    import mx.rpc.wsdl.WSDLEncoding;
  10.    import mx.rpc.wsdl.WSDLMessagePart;
  11.    import mx.rpc.wsdl.WSDLOperation;
  12.    import mx.rpc.xml.ContentProxy;
  13.    import mx.rpc.xml.DecodingContext;
  14.    import mx.rpc.xml.SchemaConstants;
  15.    import mx.rpc.xml.SchemaDatatypes;
  16.    import mx.rpc.xml.TypeIterator;
  17.    import mx.rpc.xml.XMLDecoder;
  18.    import mx.utils.StringUtil;
  19.    import mx.utils.XMLUtil;
  20.    import mx.utils.object_proxy;
  21.    
  22.    use namespace object_proxy;
  23.    
  24.    public class SOAPDecoder extends XMLDecoder implements ISOAPDecoder
  25.    {
  26.       public static var PI_WHITESPACE_PATTERN:RegExp = /[\?][>]\s*[<]/g;
  27.       
  28.       private var _multiplePartsFormat:String;
  29.       
  30.       private var _forcePartArrays:Boolean;
  31.       
  32.       private var _headerFormat:String;
  33.       
  34.       private var log:ILogger;
  35.       
  36.       private var _resultFormat:String;
  37.       
  38.       private var _ignoreWhitespace:Boolean = true;
  39.       
  40.       private var _referencesResolved:Boolean;
  41.       
  42.       public var supportGenericCompoundTypes:Boolean = false;
  43.       
  44.       private var _wsdlOperation:WSDLOperation;
  45.       
  46.       private var _elementsWithId:XMLList;
  47.       
  48.       public function SOAPDecoder()
  49.       {
  50.          super();
  51.          log = Log.getLogger("mx.rpc.soap.SOAPDecoder");
  52.       }
  53.       
  54.       public function get soapConstants() : SOAPConstants
  55.       {
  56.          return wsdlOperation.soapConstants;
  57.       }
  58.       
  59.       override public function decodeComplexRestriction(param1:XML, param2:*, param3:QName, param4:*) : void
  60.       {
  61.          var _loc8_:ICustomSOAPType = null;
  62.          var _loc5_:SchemaConstants = schemaManager.schemaConstants;
  63.          var _loc6_:String = param1.@base;
  64.          var _loc7_:QName = schemaManager.getQNameForPrefixedName(_loc6_,param1);
  65.          if(_loc7_ == soapConstants.soapencArrayQName)
  66.          {
  67.             _loc8_ = SOAPConstants.getCustomSOAPType(_loc7_);
  68.             if(_loc8_ != null)
  69.             {
  70.                _loc8_.decode(this,param2,param3,param4,param1);
  71.                return;
  72.             }
  73.          }
  74.          super.decodeComplexRestriction(param1,param2,param3,param4);
  75.       }
  76.       
  77.       public function set multiplePartsFormat(param1:String) : void
  78.       {
  79.          _multiplePartsFormat = param1;
  80.       }
  81.       
  82.       private function resolveReferences(param1:XML, param2:Boolean = true) : void
  83.       {
  84.          var index:uint;
  85.          var child:XML = null;
  86.          var element:XML = null;
  87.          var href:String = null;
  88.          var hashPosition:int = 0;
  89.          var matches:XMLList = null;
  90.          var referent:XML = null;
  91.          var root:XML = param1;
  92.          var cleanupElementsWithIdCache:Boolean = param2;
  93.          if(_referencesResolved)
  94.          {
  95.             return;
  96.          }
  97.          index = 0;
  98.          if(_elementsWithId == null)
  99.          {
  100.             _elementsWithId = document..*.(attribute("id").length() > 0);
  101.          }
  102.          for each(child in root.children())
  103.          {
  104.             if(child.nodeKind() == "element")
  105.             {
  106.                element = child;
  107.                href = getAttributeFromNode("href",element);
  108.                if(href != null)
  109.                {
  110.                   hashPosition = int(href.indexOf("#"));
  111.                   if(hashPosition >= 0)
  112.                   {
  113.                      href = href.substring(hashPosition + 1);
  114.                   }
  115.                   matches = _elementsWithId.(@id == href);
  116.                   if(matches.length() <= 0)
  117.                   {
  118.                      throw new Error("The element referenced by id \'" + href + "\' was not found.");
  119.                   }
  120.                   referent = matches[0];
  121.                   referent.setName(element.name());
  122.                   if(referent.hasComplexContent())
  123.                   {
  124.                      resolveReferences(referent,false);
  125.                   }
  126.                   root.replace(index,referent);
  127.                }
  128.                else if(element.hasComplexContent())
  129.                {
  130.                   resolveReferences(element,false);
  131.                }
  132.             }
  133.             index++;
  134.          }
  135.          if(cleanupElementsWithIdCache)
  136.          {
  137.             _elementsWithId = null;
  138.             _referencesResolved = true;
  139.          }
  140.       }
  141.       
  142.       protected function decodeFaults(param1:XMLList) : Array
  143.       {
  144.          var _loc3_:XML = null;
  145.          var _loc4_:QName = null;
  146.          var _loc5_:String = null;
  147.          var _loc6_:String = null;
  148.          var _loc7_:XML = null;
  149.          var _loc8_:String = null;
  150.          var _loc9_:XMLList = null;
  151.          var _loc10_:XML = null;
  152.          var _loc11_:SOAPFault = null;
  153.          log.debug("SOAP: Decoding SOAP response fault");
  154.          var _loc2_:Array = [];
  155.          for each(_loc3_ in param1)
  156.          {
  157.             _loc7_ = _loc3_;
  158.             _loc9_ = _loc3_.children();
  159.             for each(_loc10_ in _loc9_)
  160.             {
  161.                if(_loc10_.localName() == "faultcode")
  162.                {
  163.                   _loc4_ = schemaManager.getQNameForPrefixedName(_loc10_.toString(),_loc10_);
  164.                }
  165.                else if(_loc10_.localName() == "faultstring")
  166.                {
  167.                   _loc5_ = _loc10_.toString();
  168.                }
  169.                else if(_loc10_.localName() == "faultactor")
  170.                {
  171.                   _loc8_ = _loc10_.toString();
  172.                }
  173.                else if(_loc10_.localName() == "detail")
  174.                {
  175.                   if(_loc10_.hasComplexContent())
  176.                   {
  177.                      _loc6_ = _loc10_.children().toXMLString();
  178.                   }
  179.                   else
  180.                   {
  181.                      _loc6_ = _loc10_.toString();
  182.                   }
  183.                }
  184.             }
  185.             _loc11_ = new SOAPFault(_loc4_,_loc5_,_loc6_,_loc7_,_loc8_);
  186.             _loc2_.push(_loc11_);
  187.          }
  188.          return _loc2_;
  189.       }
  190.       
  191.       override protected function preProcessXML(param1:XML) : void
  192.       {
  193.          if(outputEncoding.useStyle == SOAPConstants.USE_ENCODED)
  194.          {
  195.             resolveReferences(param1);
  196.          }
  197.       }
  198.       
  199.       public function get schemaConstants() : SchemaConstants
  200.       {
  201.          return schemaManager.schemaConstants;
  202.       }
  203.       
  204.       public function set forcePartArrays(param1:Boolean) : void
  205.       {
  206.          _forcePartArrays = param1;
  207.       }
  208.       
  209.       protected function decodeHeaders(param1:XML) : Array
  210.       {
  211.          var _loc4_:XML = null;
  212.          var _loc5_:QName = null;
  213.          var _loc6_:XML = null;
  214.          var _loc7_:Object = null;
  215.          var _loc8_:SOAPHeader = null;
  216.          var _loc9_:String = null;
  217.          var _loc10_:String = null;
  218.          log.debug("Decoding SOAP response headers");
  219.          var _loc2_:Array = [];
  220.          var _loc3_:XMLList = param1.elements();
  221.          for each(_loc4_ in _loc3_)
  222.          {
  223.             if(headerFormat == "object")
  224.             {
  225.                _loc5_ = getXSIType(_loc4_);
  226.                _loc6_ = null;
  227.                _loc7_ = null;
  228.                if(_loc5_ != null)
  229.                {
  230.                   _loc6_ = schemaManager.getNamedDefinition(_loc5_,constants.complexTypeQName,constants.simpleTypeQName);
  231.                }
  232.                if(_loc6_ != null)
  233.                {
  234.                   schemaManager.releaseScope();
  235.                   _loc7_ = decode(_loc4_,null,_loc5_);
  236.                }
  237.                else
  238.                {
  239.                   _loc7_ = decode(_loc4_,_loc4_.name());
  240.                }
  241.                _loc8_ = new SOAPHeader(_loc4_.name(),_loc7_);
  242.                _loc9_ = XMLUtil.getAttributeByQName(_loc4_,soapConstants.mustUnderstandQName).toString();
  243.                if(_loc9_ == "1")
  244.                {
  245.                   _loc8_.mustUnderstand = true;
  246.                }
  247.                _loc10_ = XMLUtil.getAttributeByQName(_loc4_,soapConstants.actorQName).toString();
  248.                if(_loc10_ != "")
  249.                {
  250.                   _loc8_.role = _loc10_;
  251.                }
  252.                _loc2_.push(_loc8_);
  253.             }
  254.             else if(headerFormat == "e4x")
  255.             {
  256.                _loc2_.push(_loc4_);
  257.             }
  258.             else if(headerFormat == "xml")
  259.             {
  260.                _loc2_.push(new XMLDocument(_loc4_.toString()));
  261.             }
  262.          }
  263.          return _loc2_;
  264.       }
  265.       
  266.       override public function decodeComplexType(param1:XML, param2:*, param3:QName, param4:*, param5:XML = null, param6:DecodingContext = null) : void
  267.       {
  268.          var _loc7_:XML = null;
  269.          if(param4 is XML)
  270.          {
  271.             _loc7_ = param4 as XML;
  272.             if(_loc7_.elements(SOAPConstants.diffgramQName).length() > 0 && _loc7_.elements(schemaConstants.schemaQName).length() > 0)
  273.             {
  274.                decodeType(SOAPConstants.diffgramQName,param2,_loc7_.name(),param4);
  275.                return;
  276.             }
  277.          }
  278.          super.decodeComplexType(param1,param2,param3,param4,param5,param6);
  279.       }
  280.       
  281.       protected function get inputEncoding() : WSDLEncoding
  282.       {
  283.          var _loc1_:WSDLEncoding = null;
  284.          if(_wsdlOperation.inputMessage != null)
  285.          {
  286.             _loc1_ = _wsdlOperation.inputMessage.encoding;
  287.          }
  288.          else
  289.          {
  290.             _loc1_ = new WSDLEncoding();
  291.          }
  292.          return _loc1_;
  293.       }
  294.       
  295.       protected function decodeBody(param1:XML, param2:SOAPResult) : void
  296.       {
  297.          var _loc3_:* = undefined;
  298.          var _loc6_:WSDLMessagePart = null;
  299.          var _loc7_:XMLList = null;
  300.          var _loc8_:XML = null;
  301.          var _loc9_:* = undefined;
  302.          var _loc10_:QName = null;
  303.          var _loc11_:QName = null;
  304.          var _loc12_:XML = null;
  305.          var _loc13_:String = null;
  306.          var _loc14_:uint = 0;
  307.          var _loc15_:QName = null;
  308.          var _loc16_:uint = 0;
  309.          log.debug("Decoding SOAP response body");
  310.          document = param1;
  311.          preProcessXML(param1);
  312.          if(wsdlOperation.outputMessage == null)
  313.          {
  314.             param2.result = undefined;
  315.             return;
  316.          }
  317.          var _loc4_:Array = wsdlOperation.outputMessage.parts;
  318.          if(_loc4_ == null || _loc4_.length == 0)
  319.          {
  320.             param2.result = undefined;
  321.             return;
  322.          }
  323.          var _loc5_:XML = param1;
  324.          if(wsdlOperation.style == SOAPConstants.RPC_STYLE)
  325.          {
  326.             _loc5_ = _loc5_.elements()[0];
  327.          }
  328.          else if(outputEncoding.useStyle == SOAPConstants.USE_LITERAL && wsdlOperation.outputMessage.isWrapped == true)
  329.          {
  330.             _loc5_ = _loc5_.elements()[0];
  331.          }
  332.          for each(_loc6_ in _loc4_)
  333.          {
  334.             if(_loc6_.element != null)
  335.             {
  336.                if(_loc5_.hasComplexContent())
  337.                {
  338.                   _loc7_ = _loc5_.elements(_loc6_.element);
  339.                }
  340.                else
  341.                {
  342.                   _loc7_ = _loc5_.text();
  343.                }
  344.                _loc10_ = _loc6_.element;
  345.                _loc11_ = null;
  346.             }
  347.             else
  348.             {
  349.                _loc11_ = _loc6_.type;
  350.                _loc12_ = _loc6_.definition;
  351.                if(_loc5_.hasComplexContent())
  352.                {
  353.                   if(outputEncoding.useStyle == SOAPConstants.USE_ENCODED)
  354.                   {
  355.                      _loc10_ = new QName("",_loc6_.name.localName);
  356.                      _loc7_ = _loc5_.elements(_loc10_);
  357.                      if(_loc7_.length() == 0)
  358.                      {
  359.                         _loc13_ = outputEncoding.namespaceURI;
  360.                         _loc10_ = new QName(_loc13_,_loc6_.name.localName);
  361.                         _loc7_ = _loc5_.elements(_loc10_);
  362.                         if(_loc7_.length() == 0)
  363.                         {
  364.                            _loc13_ = inputEncoding.namespaceURI;
  365.                            _loc10_ = new QName(_loc13_,_loc6_.name.localName);
  366.                            _loc7_ = _loc5_.elements(_loc10_);
  367.                         }
  368.                      }
  369.                   }
  370.                   else
  371.                   {
  372.                      _loc7_ = _loc5_.elements(_loc6_.name);
  373.                   }
  374.                }
  375.                else
  376.                {
  377.                   _loc7_ = _loc5_.text();
  378.                }
  379.             }
  380.             for each(_loc8_ in _loc7_)
  381.             {
  382.                _loc9_ = decode(_loc8_,_loc10_,_loc11_,_loc12_);
  383.                if(_loc4_.length > 1)
  384.                {
  385.                   if(multiplePartsFormat == "object")
  386.                   {
  387.                      if(_loc3_ == null)
  388.                      {
  389.                         _loc3_ = createContent(_loc5_.name());
  390.                         _loc3_.isSimple = false;
  391.                      }
  392.                      if(_loc3_[_loc6_.name.localName] == null)
  393.                      {
  394.                         _loc14_ = getMaxOccurs(_loc12_);
  395.                         if(_loc14_ > 1 && forcePartArrays || _loc7_.length() > 1)
  396.                         {
  397.                            _loc3_[_loc6_.name.localName] = createIterableValue(_loc6_.type);
  398.                         }
  399.                      }
  400.                      if(TypeIterator.isIterable(_loc3_[_loc6_.name.localName]))
  401.                      {
  402.                         TypeIterator.push(_loc3_[_loc6_.name.localName],_loc9_);
  403.                      }
  404.                      else
  405.                      {
  406.                         _loc3_[_loc6_.name.localName] = _loc9_;
  407.                      }
  408.                   }
  409.                   else if(multiplePartsFormat == "array")
  410.                   {
  411.                      if(_loc3_ == null)
  412.                      {
  413.                         _loc3_ = createIterableValue(_loc5_.name());
  414.                      }
  415.                      TypeIterator.push(_loc3_,_loc9_);
  416.                   }
  417.                }
  418.                else
  419.                {
  420.                   if(_loc3_ == null)
  421.                   {
  422.                      _loc15_ = _loc11_;
  423.                      if(_loc15_ == null)
  424.                      {
  425.                         _loc15_ = _loc6_.element;
  426.                      }
  427.                      if(_loc15_ == null)
  428.                      {
  429.                         _loc15_ = _loc6_.name;
  430.                      }
  431.                      _loc16_ = getMaxOccurs(_loc12_);
  432.                      if(_loc16_ > 1 && forcePartArrays || _loc7_.length() > 1)
  433.                      {
  434.                         _loc3_ = createIterableValue(_loc15_);
  435.                      }
  436.                      else
  437.                      {
  438.                         _loc3_ = createContent();
  439.                      }
  440.                   }
  441.                   if(TypeIterator.isIterable(_loc3_))
  442.                   {
  443.                      TypeIterator.push(_loc3_,_loc9_);
  444.                   }
  445.                   else
  446.                   {
  447.                      _loc3_ = _loc9_;
  448.                   }
  449.                }
  450.             }
  451.          }
  452.          if(_loc3_ is ContentProxy)
  453.          {
  454.             _loc3_ = ContentProxy(_loc3_).object_proxy::content;
  455.          }
  456.          param2.result = _loc3_;
  457.       }
  458.       
  459.       public function set wsdlOperation(param1:WSDLOperation) : void
  460.       {
  461.          _wsdlOperation = param1;
  462.          schemaManager = _wsdlOperation.schemaManager;
  463.       }
  464.       
  465.       public function get multiplePartsFormat() : String
  466.       {
  467.          return _multiplePartsFormat;
  468.       }
  469.       
  470.       public function set headerFormat(param1:String) : void
  471.       {
  472.          _headerFormat = param1;
  473.       }
  474.       
  475.       public function decodeResponse(param1:*) : SOAPResult
  476.       {
  477.          var startTime:int;
  478.          var soapResult:SOAPResult = null;
  479.          var responseString:String = null;
  480.          var oldIgnoreWhitespace:Boolean = false;
  481.          var responseXML:XML = null;
  482.          var response:* = param1;
  483.          if(response is XML)
  484.          {
  485.             responseString = XML(response).toXMLString();
  486.          }
  487.          else
  488.          {
  489.             responseString = String(response);
  490.          }
  491.          startTime = getTimer();
  492.          log.info("Decoding SOAP response");
  493.          reset();
  494.          if(responseString != null)
  495.          {
  496.             log.debug("Encoded SOAP response {0}",responseString);
  497.             oldIgnoreWhitespace = Boolean(XML.ignoreWhitespace);
  498.             try
  499.             {
  500.                responseString = responseString.replace(PI_WHITESPACE_PATTERN,"?><");
  501.                responseString = StringUtil.trim(responseString);
  502.                XML.ignoreWhitespace = ignoreWhitespace;
  503.                responseXML = new XML(responseString);
  504.                soapResult = decodeEnvelope(responseXML);
  505.             }
  506.             finally
  507.             {
  508.                XML.ignoreWhitespace = oldIgnoreWhitespace;
  509.             }
  510.          }
  511.          log.info("Decoded SOAP response into result [{0} millis]",getTimer() - startTime);
  512.          return soapResult;
  513.       }
  514.       
  515.       override public function decodeType(param1:QName, param2:*, param3:QName, param4:*, param5:XML = null) : void
  516.       {
  517.          var _loc9_:SchemaDatatypes = null;
  518.          var _loc10_:String = null;
  519.          var _loc11_:SchemaConstants = null;
  520.          var _loc12_:XML = null;
  521.          var _loc6_:QName = param1;
  522.          var _loc7_:QName = getXSIType(param4);
  523.          if(_loc7_ != null)
  524.          {
  525.             param1 = _loc7_;
  526.          }
  527.          if(outputEncoding.useStyle == SOAPConstants.USE_ENCODED)
  528.          {
  529.             if(SOAPConstants.isSOAPEncodedType(param1))
  530.             {
  531.                _loc9_ = schemaManager.schemaDatatypes;
  532.                if(param1 == soapConstants.soapBase64QName)
  533.                {
  534.                   param1 = _loc9_.base64BinaryQName;
  535.                }
  536.                else
  537.                {
  538.                   _loc10_ = param1.localName;
  539.                   if(_loc10_ != "Array" && _loc10_ != "arrayType")
  540.                   {
  541.                      param1 = schemaConstants.getQName(_loc10_);
  542.                   }
  543.                }
  544.             }
  545.          }
  546.          var _loc8_:ICustomSOAPType = SOAPConstants.getCustomSOAPType(param1);
  547.          if(_loc8_ != null)
  548.          {
  549.             _loc8_.decode(this,param2,param3,param4,param5);
  550.             setXSIType(param2,param1);
  551.          }
  552.          else
  553.          {
  554.             _loc11_ = schemaManager.schemaConstants;
  555.             if(isBuiltInType(param1))
  556.             {
  557.                super.decodeType(param1,param2,param3,param4,param5);
  558.             }
  559.             else
  560.             {
  561.                _loc12_ = schemaManager.getNamedDefinition(param1,_loc11_.complexTypeQName,_loc11_.simpleTypeQName,_loc11_.elementTypeQName);
  562.                if(_loc12_ != null)
  563.                {
  564.                   schemaManager.releaseScope();
  565.                   super.decodeType(param1,param2,param3,param4,param5);
  566.                }
  567.                else
  568.                {
  569.                   super.decodeType(_loc6_,param2,param3,param4,param5);
  570.                }
  571.             }
  572.          }
  573.       }
  574.       
  575.       public function get forcePartArrays() : Boolean
  576.       {
  577.          return _forcePartArrays;
  578.       }
  579.       
  580.       public function set ignoreWhitespace(param1:Boolean) : void
  581.       {
  582.          _ignoreWhitespace = param1;
  583.       }
  584.       
  585.       public function get wsdlOperation() : WSDLOperation
  586.       {
  587.          return _wsdlOperation;
  588.       }
  589.       
  590.       public function get headerFormat() : String
  591.       {
  592.          return _headerFormat;
  593.       }
  594.       
  595.       public function set resultFormat(param1:String) : void
  596.       {
  597.          _resultFormat = param1;
  598.       }
  599.       
  600.       protected function decodeEnvelope(param1:XML) : SOAPResult
  601.       {
  602.          var _loc3_:Namespace = null;
  603.          var _loc4_:SchemaConstants = null;
  604.          var _loc5_:Array = null;
  605.          var _loc6_:Namespace = null;
  606.          var _loc7_:XML = null;
  607.          var _loc8_:XML = null;
  608.          var _loc9_:XMLList = null;
  609.          var _loc10_:Array = null;
  610.          var _loc11_:XMLList = null;
  611.          var _loc12_:XML = null;
  612.          var _loc13_:String = null;
  613.          var _loc14_:XMLDocument = null;
  614.          var _loc15_:XMLNode = null;
  615.          log.debug("Decoding SOAP response envelope");
  616.          var _loc2_:SOAPResult = new SOAPResult();
  617.          if(param1 != null)
  618.          {
  619.             _loc3_ = param1.namespace();
  620.          }
  621.          if(_loc3_ == null)
  622.          {
  623.             throw new Error("SOAP Response cannot be decoded. Raw response: " + param1);
  624.          }
  625.          if(_loc3_.uri != SOAPConstants.SOAP_ENVELOPE_URI)
  626.          {
  627.             throw new Error("SOAP Response Version Mismatch");
  628.          }
  629.          _loc5_ = param1.inScopeNamespaces();
  630.          for each(_loc6_ in _loc5_)
  631.          {
  632.             schemaManager.namespaces[_loc6_.prefix] = _loc6_;
  633.          }
  634.          _loc7_ = param1[soapConstants.headerQName][0];
  635.          if(_loc7_ != null)
  636.          {
  637.             _loc2_.headers = decodeHeaders(_loc7_);
  638.          }
  639.          _loc8_ = param1[soapConstants.bodyQName][0];
  640.          if(_loc8_ == null || _loc8_.hasComplexContent() == false || _loc8_.children().length() <= 0)
  641.          {
  642.             _loc2_.result = undefined;
  643.          }
  644.          else
  645.          {
  646.             _loc9_ = _loc8_[soapConstants.faultQName];
  647.             if(_loc9_.length() > 0)
  648.             {
  649.                _loc2_.isFault = true;
  650.                _loc2_.result = decodeFaults(_loc9_);
  651.             }
  652.             else if(resultFormat == "object")
  653.             {
  654.                decodeBody(_loc8_,_loc2_);
  655.             }
  656.             else if(resultFormat == "e4x")
  657.             {
  658.                _loc2_.result = _loc8_.children();
  659.             }
  660.             else if(resultFormat == "xml")
  661.             {
  662.                _loc10_ = [];
  663.                _loc11_ = _loc8_.children();
  664.                for each(_loc12_ in _loc11_)
  665.                {
  666.                   _loc13_ = _loc12_.nodeKind();
  667.                   if(_loc13_ == "element")
  668.                   {
  669.                      _loc14_ = new XMLDocument(_loc12_.toString());
  670.                      _loc15_ = _loc14_.firstChild;
  671.                      _loc10_.push(_loc15_);
  672.                   }
  673.                   else if(_loc13_ == "text")
  674.                   {
  675.                      _loc10_.push(_loc12_.toString());
  676.                   }
  677.                }
  678.                _loc2_.result = _loc10_;
  679.             }
  680.          }
  681.          return _loc2_;
  682.       }
  683.       
  684.       override public function reset() : void
  685.       {
  686.          super.reset();
  687.          _referencesResolved = false;
  688.          _elementsWithId = null;
  689.       }
  690.       
  691.       protected function get outputEncoding() : WSDLEncoding
  692.       {
  693.          var _loc1_:WSDLEncoding = null;
  694.          if(_wsdlOperation.outputMessage != null)
  695.          {
  696.             _loc1_ = _wsdlOperation.outputMessage.encoding;
  697.          }
  698.          else
  699.          {
  700.             _loc1_ = new WSDLEncoding();
  701.          }
  702.          return _loc1_;
  703.       }
  704.       
  705.       public function get ignoreWhitespace() : Boolean
  706.       {
  707.          return _ignoreWhitespace;
  708.       }
  709.       
  710.       public function get resultFormat() : String
  711.       {
  712.          return _resultFormat;
  713.       }
  714.       
  715.       override protected function parseValue(param1:*, param2:XMLList) : *
  716.       {
  717.          var _loc3_:QName = null;
  718.          var _loc4_:XMLList = null;
  719.          if(supportGenericCompoundTypes && outputEncoding.useStyle == SOAPConstants.USE_LITERAL && param2.length() > 0)
  720.          {
  721.             _loc3_ = new QName(param2[0].name().uri,"item");
  722.             _loc4_ = param2.elements(_loc3_);
  723.             if(_loc4_.length() > 0)
  724.             {
  725.                param2 = _loc4_;
  726.             }
  727.          }
  728.          return super.parseValue(param1,param2);
  729.       }
  730.    }
  731. }
  732.  
  733.