HTTPService despair

It is a desperate situation for me...

I have a little HTTPService is ready to be called when needed... However, I noticed that after about 5 minutes, the service (one of them) is sent again. I tried to implement concurrency = "single" and also a httpService.disconnect (); After each answer... no go. It's so frustrating! It is a VERY desperate situation for me. I would be grateful some knowledge!

Well, I learned something new... after the creation of my own trace function and write a log on the server, I have discovered that, when you create a popup and initiate a Timer, that Timer class class is not remove as well as context menu. Thus the HTTPService has been called once when I called him manually, and once more when the timer officially out.

Word to Adobe: when a child is removed from the display list, so everything that the child is also. Really well.

Thanks for your help anyway, Greg. You brought me to this conclusion.

Tags: Adobe LiveCycle

Similar Questions

  • HTTPService result

    Hi friends,

    I have a HTTPService I'm having the problem, try to use the returned data. I have a ColdFusion component that returns data in XML format.

    When I use dataProvider = "{objService.lastResult.projdata.datarows}" it works very well and the line chart shows data. "

    But, when I try to use the data returned in the 'Result' event with an event handler, the table is empty. Can someone tell me what could go wrong? My code in the result handler looks like this

    < mx:ArrayCollection id = source = "{ArrayUtil.toArray (event.result.projdata.datarows)"acProjData"}" / >

    The variable 'acProjData' has already been declared as a variable bindable by using

    [Bindable]

    private var acProjData:ArrayCollection;

    I'm not very familiar with programming Flex 4.5. I'm just trying to learn and hope to get my prototype work. Thank you.

    -Milind Joshi

    Answering my own question:

    I changed the line

    for this

    acProjData = event.result.projdata.datarows as ArrayCollection collection;

    My table now displays the data.

    -Milind

  • How urlencode dynamic parameter in the HTTPService url

    I created a small dashboard that uses a dynamic url for the HTTPService getting tha data for the chart. The url gets its querystring (a username) to the flashvars parameter in the wrapper. SRV. URL works great and fills in my table when the user name does not need to be encoded URL, but how can I urlencode the username that I need to do?

    This is an excerpt from the packaging:
    < script type = "text/javascript" >
    var flashvars = {};
    flashvars. UserName = 'Heather % 20% c3% 98zer ";

    Comment: I intend to dynamically generate the user name Although the above example is static. The user name is encoded in the wrapper.

    This is an excerpt from the source MXML:

    < s:Application creationComplete = "initVars ()" > "

    [Bindable]
    public var urlXML1:String;
    private function initVars (): void {}
    urlXML1 = FlexGlobals.topLevelApplication.parameters.UserName;
    SRV. URL ="http://myserver.com/xml/YourSales.aspx?UserName=" + urlXML1.toString ();
    SRV. Send();
    }

    < mx:HTTPService id = "srv" url = "/ >

    < mx:ColumnChart id = dataProvider = "{srv.lastResult.Data.Result"myChart"}"... "

    Comment: urlXML1.toString () above should be encoded. This is my problem in my opinion. I can't wait to hear your advice.

    Best regards Bo


    var objParam:Object = {};

    objParam ["UserName"] = urlXML1.toString ();

    SRV. "URL ="http://myserver.com/xml/YourSales.aspx ";

    SRV. Method = "GET";

    SRV. Send (objParam);

  • HTTPService in as3

    Hello

    I'm relatively new to AS and I have some problems using the VO HHTPService, I created.

    Here is my code:

    package ValueObjects

    {

    Import mx.rpc.events.ResultEvent;

    Import mx.rpc.http.HTTPService;

    [Bindable]

    public class indicator

    {

    protected var service: HTTPService;

    public void indicator (id int, name String, group_id:int, alias: String)

    {

    }

    public function getfields (): void

    {

    This.service = new HTTPService();

    service.url = " " http://localhost/autoTradePHP/indicators/getIndicatorFields/ "+ this.indicatorID; "

    trace (service. (URL);

    service.addEventListener (ResultEvent.RESULT, createFields);

    service. Send();

    }

    public void createFields(event:ResultEvent):void

    {

    trace ("got here");

    service.removeEventListener (ResultEvent.RESULT, createFields);

    }

    }

    }

    My problem is that for some reason that I do not get the result. not getting do not track "got here" - it seems that the createFields function is not invoked.

    Anyone has any idea why?

    Thanks in advance

    Ravid

    Never mind.

    Apparently, the problem was on the side server.

    There was a guy in the generated XML and Flex "event.fault.faultDetail" was not undefined for this purpose I have no error.

    Use "event.fault.faultString" fault string.

  • Error when loading data from a file XML using HTTPService

    Hi all

    I have a runtime error that made me beat right now I am building an App in Flash Builder 4 to run on AIR.

    The error is as follows: TypeError: Error #1009: cannot access a property or method of a null object reference.

    What I'm doing:

    I have 2 DropDownList controls, the first is filled with the names of countries and the other with the language options.  All 1 DropDownList control

    set to an image control to display the flag of the country and activate the 2nd DropDownList.

    The 2nd DropDownList control sets the returned variable equal to the language code.  I then call the function in the language and pass it returned using this variable, I build the string

    for langFilePath will be equal to the XML file (which is "Lang_GBR.xml") location on my desktop and then call the HTTPService.

    As soon as the function of language is called, the runtime error occurs and highlights the line with btn_LS_mainMenu.label = loadLangService.lastResult.Lang.GlobalTags.btnMenu;

    When I try to assign the label of button with a new value in the XML file.

    I suspect that maybe it's a trivial mistake, but I can't see it at the moment.

    Any help or advice would be appreciated.  Thank you

    Code:

    <fx:Script>
            <![CDATA[
                   
                   [Bindable]
                   public var langFilePath:String;
    
                   public var langDir:File = File.desktopDirectory;
                   public var langCode:String;
                   
                   public function countrySelect_changeHandler(event:IndexChangeEvent):void
                   {
                        switch (countrySelect.selectedItem)
                        {  
                             case ('United Kingdom'):  
                                  trace("Item Selected was: "+ countrySelect.selectedItem);
                                  img_countryFlag.source = AngolaFlag;
                             break;
                             case ('France'):  
                                   trace("Item Selected was: "+ countrySelect.selectedItem);
                                   img_countryFlag.source = AustraliaFlag;
                             break; 
                             default:  
                             break;
                         } 
                        langSelect.enabled = true;
                        trace("1st dropdownbox");
                   }
    
                   
                   public function langSelect_changeHandler(event:IndexChangeEvent):void
                   {
                        switch (langSelect.selectedItem)
                        {                                          
                             case ('English'):  
                                 trace("Language Selected was: "+ langSelect.selectedItem);
                                 langCode = "Lang_GBR";  
                             break;
                             case ('French'):  
                                 trace("Language Selected was: "+ langSelect.selectedItem);
                                 langCode = "Lang_FRA";  
                             break;
                        }
                        language(langCode);
                    }
    
                   public function language(aParam:String):void
                   {
                        trace("Code Was: " + aParam);
                        trace("Lang dir: " + langDir.nativePath);
             
                        langFilePath = langDir.nativePath + "/" + aParam + ".xml";
             
                        trace("File to load: " + langFilePath);
                        trace("loadLangFile.url: " + loadLangService.url);
                        loadLangService.send();
                        
                        btn_LS_mainMenu.label = loadLangService.lastResult.Lang.GlobalTags.btnMenu;
                   }
              ]]>
    </fx:Script>
    
    
    <fx:Declarations>
         <s:HTTPService id="loadLangService" url="{langFilePath}"/>
    </fx:Declarations>
    
    
    <s:DropDownList x="10" y="201" id="countrySelect" prompt="Please Select Your Country" width="274" enabled="true" change="countrySelect_changeHandler(event)">
    
    <s:DropDownList x="10" y="348" id="langSelect" prompt="Please Select Your Language" width="274" enabled="false" change="langSelect_changeHandler(event)">
    
    

    Not sure on your XML structure, but for now I see the problem here between these 2 lines of code:

    loadLangService.send();
                       
    btn_LS_mainMenu.label = loadLangService.lastResult.Lang.GlobalTags.btnMenu;

    Data do you your httpService supposed to receive just cannot go so fast to fill the lastResult before calling it in the following line

    Try to add a listener to result at your service before sending:

    .....

    loadLangService.addEventListener (ResultEvent.RESULT, handler);

    loadLangService.send();

    ......

    function handler(event:ResultEvent):void {

         btn_LS_mainMenu.label = loadLangService.lastResult.Lang.GlobalTags.btnMenu;

    }

  • Result of the handful of XML data with httpservice

    Hello

    Please find my xml data http://121.242.211.152/janaagraha/get_complaints

    I need to load these xml data through httpservice and depending on the result of the handle, I need access to individual data as complaints.complaint.title using the service loop. I tried this I could not get the result I need

    " < s:HTTPService id = 'Complaints' url = ' http://121.242.211.152/Janaagraha/get_complaints "result ="Complaints_resultHandler (event)"fault =" Complaints_faultHandler (event) "> "

    < / s:HTTPService >

    < fx:Script >

    <! [CDATA]

    protected function Complaints_resultHandler(event:ResultEvent):void

    {

    var complaintarray:ArrayCollection = event.result.complaints.complaint;

    var carray:Array = complaintarray.toArray ();

    for (var i: Number = 0; i < carray.length; i ++)

    {

    var cmparray:Array is ObjectUtil.toString(carray[i]).split('~~~');.

    Title: string var = ObjectUtil.toString(cmparray[0]);

    Alert.Show ("HI" + title);

    }

    }

    Please suggest I need to get data like title, complainturl, latitude longtitude etc.

    Concerning

    Jeremi

    Your node of categories is not necessary contain two category nodes, check if there is in fact two categories:

    var complaint_cat:XMLList = complaint.categories.category;
    if(complaint_cat.length() > 0){
         var mainCategory:String = complaint_cat[0].toString();
         if(complaint_cat.length() > 1){
              var subCategory:String = complaint_cat[1].toString();
         }
    }
    trace("main category: " + mainCategory + ", sub category: " + subCategory);
    

    --

    Kenneth Kawamoto

    http://www.materiaprima.co.UK/

  • HTTPService fail to send parameters

    Flash Builder 4.5

    Flash Player 10.3

    Windows 7 pro 64-bit

    problem,

    I send an object as parameters http, but it never come on the web server.

    help welcomed.

    more information,

    Flash builder network monito shows the http request to include parameters.

    Wireshark shows that there are no parameters in the http request.

    source code

    < fx:Script >

    <! [CDATA]

    import com.adobe.serialization.json.JSON;

    import com.adobe.serializers.json.JSONEncoder;

    Import mx.rpc.events.FaultEvent;

    Import mx.rpc.events.ResultEvent;

    Import mx.rpc.http.HTTPService;

    protected function button1_clickHandler(event:MouseEvent):void

    {

    var streamParams:Object = new Object;

    streamParams.title = "demo";

    streamParams.quality = 1;

    vidictionService.contentType = "application/json";

    vidictionService.send (streamParams);

    }

    protected function httpResultHandler(evt:ResultEvent):void

    {

    trace ("InitView.httpResultHandler ()" + evt.result.toString () ");

    navigator.pushView (seen. MobileLiveHomeView, {streamParams:evt.result});}

    }

    protected function httpFaultHandler(evt:FaultEvent):void

    {

    trace ("InitView.httpFaultHandler ()" + evt.toString () ");

    }

    []] >

    < / fx:Script >

    < fx:Declarations >

    < s:HTTPService id = "vidictionService".

                           url=" http://192.168.2.104:9000/stream/record "

    Fault = "httpFaultHandler (Event)" "

    result = "httpResultHandler (Event)" "

    resultFormat ="object"

    showBusyCursor = "true" / >

    < / fx:Declarations >

    < s:Button low = "10" label = "Publish" click = "button1_clickHandler (event)" horizontalCenter = "0" / > "

    found the solution:

    vidictionService.method = "POST";

    vidictionService.send (JSON.encode (streamParams));

  • Problem with characters Germans httpservice

    Hello

    I am trying to send the German characters in a httpservice call (POST method). Somehow, the characters are getting blurred. Can someone help me please?

    for example

    Im trying to send = Küche

    What is actually get sent = ka¼che

    Thanks in advance.

    SID

    Without pasting any code, it is difficult to know where he's going poorly, but more than likely, it is on the side of PHP.

    In Flex the data must be coded in UTF-8 format, and when in a POSITION must encode the bytes of UTF-8 with the appropriate encoder, then send the string to your PHP application.

    I would like to start looking at your side PHP, ensuring that you know you look that UTF-8 data and not ISO-8859-1 bytes, as what you see is a typical problem of confusion IS0-8859-1 and UTF-8. If the display of data in a database, check your columns are encoded in UTF - 8 etc.

    You can try to post form data in a simple html, specific using UTF-8 encoding form your PHP application and verification, it wokrs very well with that, once you have that repaired and checked, then try again with the flex application.

  • HTTPService to get hit emulator but not phone itself

    I develop an application that hits two HTTPServices - one after the other. My app works very well in the emulator, but success only deployed app the first HTTPService and does not seem to hit the 2nd one at all. I'm completely puzzled and if someone could help me, I would be eternally grateful. My code is below. Thanks in advance!

    < fx:Declarations >

    <! - Place non-visual elements (e.g., services, items of value) here - >

    < s:HTTPService id = " WebServiceNumber1 " resultFormat =" text " " "

    result = "ProcessOutputsOfWebServiceNumber1 (event)" showBusyCursor ="true""">

    http://domain.com/api/json?blah & sensor = false < s:url >< / s:url >

    < / s:HTTPService>

    "" < s:HTTPService id = "WebServiceNumber2" resultFormat = " text "result = "ProcessOutputsOfWebServiceNumber2 (event)" showBusyCursor = " true " " > "

    < s:url > http://domain.com/API/ASDF/JSON?blah & Sensor = false < / s:url >

    < / s:HTTPService>

    < / fx:Declarations >

    private function init():Sub

    {

    I want to hit the web service 2nd after the 1st to fill a

    WebServiceNumber1.addEventListener ('result', CallWebServiceNumber2);

    WebServiceNumber1.send (); / / No problem

    }

    private void ProcessOutputsOfWebServiceNumber1(event:ResultEvent):void

    {

    var strJSONResponse:String = String (event.result);

    things being done, everything works

    }                             

    private void CallWebServiceNumber2 (event: ResultEvent): void

    {

    WebServiceNumber2.send();//works in the emulator, not sure about phone

    lblTest.text = " WebServiceNumber2. send() pulled off..." » ;

    / / the above statement works, and the label gets changed

    }

    private void ProcessOutputsOfWebServiceNumber2(event:ResultEvent):void

    {

    var strJSONResponse:String = String (event.result); works in the emulator, not phone

    lblTest.text = strJSONResponse;                works in the emulator, phone no

    }

    Hello

    #1

    consider adding handlers for ResultEvent see if there is something wrong when executing

    #2

    You can take your second http service manager already set for the first service (do not know why you said two managers different just do the same job - but in different places). If your manager of "ProcessOutputsOfWebServiceNumber1" could be used to make the two functions (results management and update of second service) I think

    #3

    you could try to update params string by adding random id to check if what you are observing might be due to implementing caching on the device, see very easy implemented:

    [Bindable]

    private var randomID:int = 0;

    protected function udpateServiceHandler(event:MouseEvent):void

    {

    randomID = (new Date () .getTime ());

    WebServiceNumber2.send ();

    }

    http://www.domain.com/index.php?RID= {randomID}

    Before calling send() on webservice just update the random settings and that the change will be propagated through links.

    Kind regards

    Peter

  • HTTPService with XML format errors when XML is empty. How can I test the value?

    I have a simple HTTPService that returns XML code. 99% of the time there are values and all is right with the world, but sometimes there is no values and my xml looks like this

    <?xml version="1.0" encoding="UTF-8" ?> 
      <node /> 
    
    

    It is quite valid. How can I test this and avoid

    ReferenceError: Error #1069: node not found property on flash.xml.XMLNode and there is no default value.

    I tried

    If

    Normally the XML with the look as values

    (event.result.node == null)

    <node>
    -     <node label="MYLABEL1" id="231" type="O" />
          <node label="MYLABEL2" id="263" type="O" />
      </node>
    
    
    
    

    This Punch and see what happens:

    var xml =

    ;

    If (xml.hasOwnProperty ("node"))

    {

    trace ("neat!");

    }

    var xmlList1:XMLList = xml.node.attribute ("attribute1");

    If (xmlList1.length () > 0)

    {

    trace ("attribute1 found.');

    }

    var xmlList3:XMLList = xml.node.attribute ("attribute3");

    If (xmlList3.length () > 0)

    {

    trace ("attribut3 found!'); This will not be found

    }

    Of course, the try-catch blocks are my usual method of getting XML incorrect, but it's a little hokey.

  • HTTPService problem (cache)

    Hi friends

    I'm working on a flex-java application in which I use httpservice request and struck java and get the answer on my response Manager

    Here is my request format.

    < s:HTTPService id = "httpData" resultFormat = "e4x" fault = "onFault (event)" "
    useProxy result = "onResultHandler (Event)" = "false" / > "

    But first it works fine.but when I send the same settings once again, that it will provide the same answer to the same cache not hit my jsp page.but when I change the parameter it will be working again fine.but second time for the same parameter that will be once again same answer without hitting the jsp page.can any body guide me how to clear that puts cache so that I get a soft answer in my resulthandler on every shot. Even I don't get the place where response and call my resulthandler with the old data for a + ve values.waiting meet...

    Thanks and greetings

    Vineet Osho

    You can send additional parameters in the url (Whilch will not affect your code)

    as

    http://localhost: 8080/someurl? param1 = yourvalue & RandomParameter = Math.Random () * 1000

  • HTTPService: POST + byte-stream data?

    Hi everyone,.

    I am stuck for quite some time on a problem, look here and there on the forums after a solution but still fragmentary.

    If you allow me, I would like to expose to you people:

    My Flex (3.5 sdk) project to record a sound and then must send it to a web page. The equivalent in terms of form must be exactly as:

    " < form method ="post"action ="http://www.myDomain.be/myFile.php"enctype =" multipart/form-data"> "

               < table >                                                              

    data < tr > < td >: < table > < td > < input type = "file" name = "data" / > < table > < /tr >

    audioSamplingRate < tr > < td >: < table > < td > < input type = "text" name = "audioSamplingRate" value = "22050" / > < table > < /tr >

    audioBigEndian < tr > < td >: < table > < td > < input type = "text" name = "audioBigEndian" value = "false" / > < table > < /tr >

    < /table >

    < input type = "submit" / >

    < / make >

    I try to find the exact equivalent in flex using HTTPService and URLLoader, etc... But I can't seem to do this simple thing: send my byteArray (as one. RAW file) to the page web with classic post datas as would send the form above.

    FWI, I managed to send the byteArray with a content type ' application/octet-stream', but don't not to send data of PUBLICATION regular at the same time (GET work, but should not be used).

    I would be infinitely grateful is someone could put me on the right path for the answer

    PS: Sorry for my English, French is my mother tongue.

    These classes are for Amazon S3 (Simple Storage Service).

    Here is an example I found using as3httpclient for a multipart POST.

    Update: and here is an updated link that mentions this article.

  • HTTPService sends not parameter

    I'm quite new to Flex/Flash programming; However, I am quite familiar with OBJECT oriented programming. I use Flex 4 for this project.

    I am running into a problem of transmission of a parameter in an aspx file using HTTPService. I tested the aspx file in a browser (which generates xml data) and it works perfectly well with results showing as expected. The function I use to call my data is used in the application as "creationComplete" tag

    For some reason any the following does not send a parameter...

    private function init (): void {}

    var params: Object = {};

    params ["Act"] = "count with all."

    httpServ.send (params);

    }

    .. compare this code sends a request to the page and gets the output I've provided for sending no parameters (which is nothing; no xml). So a datagrid empty!

    However, after some research on googled around, I found other methods of adding a parameter and came across this method...

    private function init (): void {}

    httpServ.url = "http://localhost/awesomedir/FreeServ.aspx'+' '? ' + 'Act = count with all'; "

    httpServ.send ();

    }

    It works like a charm. Absolutely perfect... I get the xml data in my datagrid.

    I really want to get the first approach to work and the approach I've seen where params ["Act"] = "count with all." becomes params.act = count with "all"; but I had no luck with either. Anyone know why send the params object would fail?

    I think it depends on the code in your aspx page. I have no problem to send objects to the .NET web services.

    Maybe your main code expects parameters of url rather than the real settings?

  • HTTPService and ResultEvent execution order

    Hello

    I have a function that I call to get data using a HTTPService, that has an eventlistener that calls another function to manage the data of the service receives.

    I wish I had my function that contains the function that returns a Boolean value based on whether the data has loaded the service. Something like:

            public function serviceFunction():Boolean 
            {
                ...
                service.addEventListener(ResultEvent.RESULT, dataFunction);
                ...
                service.send();
                return this.loaded;
                
            }          
    
            private function dataFunction(e:ResultEvent):void 
            {
                    if(e.result.data == loaded) {
                        this.loaded= true;                    
                    } else {
                        this.loaded= false;                    
                    }
    
                }
    

    When doing it this way, I find that the return statement is executed before the code within the function data.

    Is there a way to be able to return the Boolean value, updated in the first function?

    Thank you

    Alex.

    In short, no.. You're stuck with the asynchronous event in Flex. However, if you go out into the realm of JavaScript using the ExternalInterface, you can remove the synchronous data calls. However, there are not a lot of value to it. If you want to lock the State of your application while you wait for some kind of answer, just do this through the user interface.

  • HTTPService to localhost does not work in Flex4... Even with crossdomain.xml

    So, it worked before I recompiled with Flex4, (in Flex 3.5) and now I can't get the following to work...

    History:

    I use httpservice in flex as:

    "" < mx:HTTPService id = "methods" url = "http://localhost/parser.php"method = "POST" showBusyCursor = "true" resultFormat = "e4x" result ="xmlresultHandler (event)" fault = "faultHandler (event)" / > "

    Everything is in my directory on my web server. When run in debugging or directly from flashbuilder, the call works fine. If I ran a release build, FTP in/var/www rejection (my roots) and try to access the server, the site pulls upward, and the series of swf files, but I always get a

    Fault: Channel .Security .error

    FaultString: 'error of security to access the url.

    faultDetail: ' Destination: DefaultHTTP.

    When it tries to read the httpservice.

    I have a crossdomain.xml file in my folder/var/www (webroot) with what I see as a permissive super settings... Below:

    <? XML version = "1.0"? >
    <! DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd" > ""
    < cross-domain-policy >
    "< allow-access-from domain =" "*" ports = "*" / >
    < site permitted-cross-domain-policies of control = 'all' / >
    "< allow-http-request-headers-from domain =" "*" headers = "*" / >
    < / cross-domain-policy >

    Any help would be GREATLY appreciated.

    You may need to set the - use-network = false compiler option.

    Project - Properties - Flex Compiler

    Add the option - use-network = false for the ' additional compiler arguments: "section.

    When deploying on a live server, you probably need to recompile it with the option - use-network = true.

    Who knows, maybe in your situation, it must be set to true.

    If this post answers your question or assistance, please mark it as such.

    Greg Lafrance - Flex 2 and 3 certified ACE

    www.ChikaraDev.com

    Training Flex and Support Services

Maybe you are looking for