8 Replies Latest reply: Apr 25, 2012 3:13 PM by Flemian RSS

    Logging into file with Flex using Blazeds

    Flemian Community Member

      Hi there!

       

       

      I have an issue with Flex. I'm trying to log temperature values into files, they only appear on the webform. I'm using Bladeds connected to flash builder displayed on web. This is the code I'm "working on":

       

       

      Temperature_1: 2012.4.19 10:59 null°C Temperature_2: 2012.4.19 10:59 null°C

      'my-amf' pinging endpoint.

      'my-amf' channel is connected.

      'my-amf' channel sending message:

      (mx.messaging.messages::RemotingMessage)#0

        body = (Array)#1

        clientId = (null)

        destination = "XBee4"

        headers = (Object)#2

        messageId = "FA6A2953-59A4-DC52-D304-C9D3D4730D24"

        operation = "getHomerseklet1"

        source = (null)

       

       

      operation = "getHomerseklet1"

        source = (null)

        timestamp = 0

        timeToLive = 0

      '48EF32D2-511B-59E7-1EA2-C9D3D29CB739' producer connected.

      '48EF32D2-511B-59E7-1EA2-C9D3D29CB739' producer acknowledge of 'FA6A2953-59A4-DC52-D304-C9D3D4730D24'.

      'my-amf' channel sending message:

      (mx.messaging.messages::RemotingMessage)#0

        body = (Array)#1

        clientId = "C2BE2AD1-BB08-5813-6B37-EC5235ECED0B"

        destination = "XBee4"

        headers = (Object)#2

        messageId = "03834DF2-13A0-A558-8136-C9D3D49B356C"

        operation = "getHomerseklet2"

        source = (null)

        timestamp = 0

        timeToLive = 0

       

       

      Thank you in advance!

        • 1. Re: Logging into file with Flex using Blazeds
          Flemian Community Member

          Edit: This code appears in the log.

          • 2. Re: Logging into file with Flex using Blazeds
            drkstr_1 Community Member

            Your source is null.

             

            Please post the code you are using to make this request.

             

            Cheers!

            • 3. Re: Logging into file with Flex using Blazeds
              Flemian Community Member

              Hi!

               

              This is the code:

               

                          import mx.controls.Alert;

               

                          import mx.collections.ArrayCollection;

               

                          import mx.logging.targets.*;

               

                          import mx.logging.*;

               

                          import mx.messaging.messages.*;

               

               

                          protected function formItem_creationCompleteHandler(event:Event):void

               

                          {

               

                              getTemperature1Result.token = xBee4.getTemperature1();

                          }

               

                        

                          protected function formItem_creationCompleteHandler2(event:Event):void

               

                          {

               

                              getTemperature2Result.token = xBee4.getTemperature2();

                          }

               

               

                      public function initLogging():void

                      {

                             

                      Log.addTarget( new TraceTarget() );

                      var logger:ILogger = Log.getLogger("mx.rpc.Channel");

                      logger.info("Temperature_1: {0} Temperature_2: {1}", DateTimeText1.text+TemperatureText1.text,                     DateTimeText2.text+TemperatureText2.text);

                      }

               

                      <mx:CallResponder id="getTemperature1Result"/>

                 

                      <services:XBee4 id="xBee4"

                                  fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"

                                  showBusyCursor="true"/>

                      <mx:Form x="161" width="351">

                      <mx:FormItem id="formItem" creationComplete="formItem_creationCompleteHandler(event)"  width="265" height="35" label="Hőmérő_1(sárga)">

                          <mx:TextInput id="TemperatureText1" width="149" height="29"

                                        text="{getTemperature1Result.lastResult as int}°C"/>

                      </mx:FormItem>

                      <mx:FormItem width="265" height="35" label="Measurement time:">

                          <mx:TextInput id="DateTimeText1" width="149" height="29"

                                        text="{CurrentDateTimeString()}"/>

                     

                      </mx:Form>

                      <mx:CallResponder id="getTemperature2Result"/>

                      <mx:Form x="205" y="340" width="354" height="155">

                      <mx:FormItem id="formItem2" creationComplete="formItem_creationCompleteHandler2(event)" width="265" height="35" label="Hőmérő_2(piros)">

                          <mx:TextInput id="TemperatureText2" width="149" height="29"

                                        text="{getTemperature2Result.lastResult as int}°C"/>

                      </mx:FormItem>

                      <mx:FormItem width="265" height="35" label="Measurement time:">

                          <mx:TextInput id="DateTimeText2" width="149" height="29"

                                        text="{CurrentDateTimeString()}"/>

                     

                     </mx:Form>

              • 4. Re: Logging into file with Flex using Blazeds
                drkstr_1 Community Member

                You are missing some key information there...

                 

                My guess would be you are not setting up your service correctly. Try posting a very simple example application that does nothing more than call a service and traces the result. This code should be contained within a single MXML file.

                • 5. Re: Logging into file with Flex using Blazeds
                  Flemian Community Member

                  I don't know how can I apply the temperature values into log file( s) from the webpage/form. That's I'm not familiar with.

                  • 6. Re: Logging into file with Flex using Blazeds
                    Flemian Community Member

                    Should I set something up in the settings in BlazeDS enabling the temperature values to be logged in the logfile?

                    If the answer is yes can you point me to the right direction?

                    • 7. Re: Logging into file with Flex using Blazeds
                      drkstr_1 Community Member

                      I guess I don't understand the question then.

                       

                      What exactly are you trying to figure out how to do? Are you having trouble figuring out how to get the values in the form into a request? Or are you asking what to do with them once they are sent?

                      • 8. Re: Logging into file with Flex using Blazeds
                        Flemian Community Member

                        The temperature values come through BlazeDS on the web application but in the log the numbers related to the value are 0. How can I display the values in the log file too?