3 Replies Latest reply on Sep 30, 2009 2:25 AM by FranciscoSalasHortelano

    binding node value from public var

    FranciscoSalasHortelano

      Hi,

       

      I am developing an interface between an axis web service and flex.

      I must create a custom soap message, so I have define:

       

      CDATA

       

      [Bindable] public var name:String = "PRUEBAS";

       

      ...

       

          <mx:request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

                     xmlns:loc="http://XXXXXXXXX/"
                    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                         format="xml">
                       
               <loc:DarWeb soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

       


               <in0 xsi:type="loc:Elem" xmlns:dat="http://XXXXXX">
                 
                  <original xsi:type="xsd:string">{name}</original> IT DOES NOT TAKE THE VALUE OF THE BINDING VAR

       

             </in0>

       

      ....

       

      Please, someone who knows how to get the value of the var?

       

      PD: In compilation time I have the next warning:  "data binding will not be able to detect assignments to ..."

       

      Thanks in advance

      Fran

        • 1. Re: binding node value from public var
          paul.williams Level 4

          Its hard to say from the source snippets you've posted. A full mxml / actionscript file that demonstrates the problem would be more helpful.

           

          My main concern is that UIComponent has a 'name' property which is not bindable, so I'd suggest changing the name of your public variable to avoid any confusion.

          • 2. Re: binding node value from public var
            FranciscoSalasHortelano Level 1

            Thanks for your reply williams. I will try to explain better.

             

            I have an action script class called Name with the next attribs:

             

              public class Name
                  {
                       
                     [Bindable] public var name:String;
                     [Bindable] public var ape1:String;
                     [Bindable] public var cp:String;

             

             

             

                  public function Name()
                        {
                             
                              //nothing initialize   
                        }

             

            }

             

            In my mxml I have

             

            <mx:Script>
                <![CDATA[

             

                [Bindable] public var nombre:Name = new Name();

             

                ]]>
            </mx:Script>

             

             

            And the last code that are involve in my problem is the next one:

             

            <mx:WebService id="webService" wsdl="XXXX (local wsdl)" showBusyCursor="true">

             

                <mx:operation name="getNames"
                            resultFormat="e4x"
                            result="handleResponse(event);"
                            fault="handleFault(event);">

             

                     
                      <mx:request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                          xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                          xmlns:name="http://XXXXXXX"
                          xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                               format="xml">
                             
                          <name:getNames soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

             

                               <in1 xsi:type="name:Name" xmlns:name="http://XXXXXX">

                                  <name xsi:type="xsd:string"> {nombre.name}</name><!-- value from class-->
                                  <ape1 xsi:type="xsd:string">{nombre.ape1}</ape1><!-- value from class-->
                                  <cp xsi:type="xsd:string">{nombre.cp}</cp><!-- value from class-->
                               </in1>

             

                       </name:getNames>               
                     </mx:request>
                           
                      </mx:operation>

             

                </mx:WebService>

             

            I can not retrieve class attribute´s values, so the xml nodes are null.

             

             

            Thanks a lot for those who reply.

            Fran

            • 3. Re: binding node value from public var
              FranciscoSalasHortelano Level 1

              Hi at all,

               

              I have solved my problem binding node values from bindable attributes.

               

              I have constructed a local xml var, and when I called the webservice it is passed as parameter like this:

               

               

              var xml:XML = new XML ( 

               

                   <name:getNames soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"

                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                            xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                            xmlns:name="http://XXXXXXX"
                            xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
              >

               

                                 <in1 xsi:type="name:Name" xmlns:name="http://XXXXXX">

                                    <name xsi:type="xsd:string"> {nombre.name}</name><!-- value from class-->
                                    <ape1 xsi:type="xsd:string">{nombre.ape1}</ape1><!-- value from class-->
                                    <cp xsi:type="xsd:string">{nombre.cp}</cp><!-- value from class-->
                                 </in1>

               

                         </name:getNames>

              );

               

              webservice.operation.send(xml);

               

              If I intercept the soap message with a sniffer NOW I CAN SEE THE VALUES OF THE BINDING NODES.

               

              Thanks at all, and remember not include a xml with binding into mx:request. Pass it as parameter when call the ws operation.

              Fran