2 Replies Latest reply on Jul 1, 2009 2:51 AM by Florian_44

    Problem with Flex and Web Service REST

    Florian_44

      Hello,

       

      I am on a problem for about a week and I do not succeed in fixing it. I have to call
      some Web Services in a Flex application. I call one Web Service REST DocumentREST which send me back a
      XML file with a list of URL of others Web Services REST DocumentRESTt/id_Document (which correspond to Documents).
      These others Web Services REST send me back details about a document.

       

      The problem is that I can't find a way to go throught all the Web Services in the
      list to get the name (which is a node of the result of the Web Services in the list) of a
      document and put it in a TextInput. I only manage to get the first of the loop.

       

      My XML file returned by the Web Service DocumentREST is in documentFeed and is like :
      <documents>
      <document>url_d_un_document</document>
      <document>url_d_un_document</document>
      <document>url_d_un_document</document>
      <document>url_d_un_document</document>
      </documents>


      [Bindable]
      private var informationsFeed:XML;
      [Bindable]
      public var urlInfo:String="";

      private function Name():void{
      var i:int;
      Alert.show("taille "+this.documentsFeed.document.length());
      for (i=this.documentsFeed.document.length()-1;i>=0;i--){
      this.urlInfo=this.documentsFeed.document[i];
      this.informationsService.send();
      Alert.show(urlInfo);
      (PanelType)(this.coverflow.getChildAt(i)).nom.text=informationsFeed.nom;
      if (informationsFeed.nom == null){
      Alert.show("faux");
      }
      this.urlInfo="";
      this.informationsFeed=new XML();
      }
      }



      <mx:HTTPService id="informationsService"
      url="{urlInfo}"
      resultFormat="e4x"
      result="informationsResultHandler(event)"
      fault="informationsFaultHandler(event);"/>

       

      Thanks