Flex :: Multiple HTTPService Requests With AIR

Nov 17, 2009

I am developing an AIR application with Flex Builder that requires me to make two HTTPService requests at the same time. They both use different instances of the HTTPService AS3 class. Both services are calling a RESTful API which is currently running on my localhost (XAMPP) and takes a few seconds to respond (much quicker on live server). The problem is that most of the time one of the calls fails, however occasionally they do both work. Its also random as to which call will fail. Both calls use code something like this. This code is basically repeated in two classes.

[Code]....

View 3 Replies


Similar Posts:


Actionscript :: Make HttpService Requests Synchronous In Flex?

Nov 24, 2009

Is it possible to make httpService Requests synchronous in Flex?

View 2 Replies

Flex :: Blazeds - RemoteObject - Handling Multiple Requests?

Jul 11, 2009

I have a couple of remote object methods that I want to respond to in different ways depending on the context, but I'd rather not set up a bunch of different RemoteObject aliases.Some background: Let's say I have an admin application that displays sales stats in different ways. The remote method looks like:

<mx:RemoteObject id="rpt" destination="AMFServer">
<mx:method name="getSalesStats" fault="getSalesStatsFault(event)"
result = "getSalesStatsSuccess(event)" />[code]........

The getSalesStats method takes an employee ID and a sales type as its arguments. You'd call it like:

rpt.getSalesStats(120, "peanuts");
public function getSalesStatsSuccess(e:ResultEvent):void {
salesdata:ArrayCollection = e.result.rows as ArrayCollection;[code]......

I'd like to pass something through the remote method to the responding function, like:

rpt.getSalesStats(120, "peanuts", "clicked button one");

but that of course throws an error because the server doesn't want that last argument.

View 6 Replies

Flex :: Multiple Async Webservice Call Requests?

Jul 26, 2011

I am using Flex and Actionscript 3, along with Webservices, rpc and a callResponder. I want to be able to, for example, say:

loadData1(); // Loads webservice data 1
loadData2(); // Loads webservice data 2
loadData3(); // Loads webservice data 3

However, Actionscript 3 works with async events, so for every call you need to wait for the ResultEvent to trigger when it is done. So, I might want to do the next request every time an event is done. However, I am afraid that threading issues might arise, and some events might not happen at all. I don't think I'm doing a good job of explaining, so I will try to show some code:

private var service:Service1;
var cp:CallResponder = new CallResponder();
public function Webservice()[code]....

I could ofcourse save the actions in an arraylist, but whose to say that the addToArrayList and the check if other calls are available do not mess eachother up, or just miss each other, thereby halting execution? Is there something like a volatile Arraylist?

View 2 Replies

Flex :: Duplicate Sessions Caused Multiple Requests With Different JSESSIONIDs?

Jul 7, 2011

I think I inherited bad code, here's the deal: In my command, I create a local var for the remote object and then call a method on it. In the result, if there's no data, I start a timer. This timer broadcasts an event every 2 seconds that continually calls this command until data is returned. Then the timer is stopped.

What we're seeing is that the method returns data once, and then the next time it doesn't (dupe Flex sessions error). It basically alternates. If we click really fast, sometimes we'll get two to work in a row. At times, the Java dev is seeing these requests returned with different JSESSIONIDs. I believe this is causing the duplicate Flex sessions error. I'm using Cairngorm; here's the execute command.

public function execute(event:CairngormEvent):void
{
ruleName = (event as FetchReportEvent).ruleName;
var ro:RemoteObject = ServiceLocator.getInstance().getRemoteObject("quantRemoteObject");
if (model.guid != null)

[code]....

View 1 Replies

ActionScript 3.0 :: Multiple HTTPService In One Flex Application?

Feb 21, 2009

Can i use multiple HTTPService in one flex application? I have tried the following but it can have only one creationComplete= " " Is their any work around?

[Code]...

View 1 Replies

ActionScript 3.0 :: Use Multiple HTTPService In One Flex Application?

Feb 21, 2009

Can i use multiple HTTPService in one flex application? I have tried the following but it can have only one creationComplete= " " Is their any work around?

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="1024" height="800" backgroundColor="white" creationComplete= "menu.send()">

[Code]...

View 2 Replies

ActionScript 3.0 :: Best Way To Handle Multiple URL Requests?

Aug 31, 2009

Any best way to handle multiple URL requests. This is what I have:
Code:
function dropCick(evt:MouseEvent):void {
if(evt.target == dropDownM.dropBtns_mc.menFoot_btn) {
var URL_6:URLRequest = new URLRequest();
URL_6.url="[URL]";
navigateToURL(URL_6,"_self");
[Code] .....
I would think there would be a better more efficient way to do this.

View 4 Replies

Flex :: Can Do Conditional GET Requests From Flash / AS?

Feb 19, 2010

I have a Flex client that loads data from a server to display a chart. This data may change, so the client regularly repeats the request. Since the result may require some work to retrieve, I'm going to have the server detect if the result has changed, and issue a 304 status if it hasn't.I haven't seen any headers in the Flash Player's requests which would indicate that it's already handling conditional GETs. Also, the HTTPService API doesn't seem to provide anything, either. Does that mean, Flash can't do this, or how can I implement this myself?

With regards to cookies, which aren't supported in Flash, I have heard the suggestion to build my own HTTP client on top of the Socket class. This might solve this issue, too, but frankly, I'm really not keen on doing that.As an alternative, I could just cache the result page and send it again, but so far, the API tries to utilize semantics that are already built into HTTP, and I'd like to keep it that way.

View 2 Replies

Flex :: Block Http Requests To Some Web-pages From Adobe Air

Jan 20, 2010

Is it any way to prevent user to go to specific web-pages using Adobe AIR framework.I want this software to run at startup and not allowing user to surf some web parts.I want to use Adobe AIR beacause of its crossplatform capabilities.

View 1 Replies

Flex :: In Mate, Sending Two Or More Requests To The Server Simultaneously?

Sep 29, 2010

I'm using Mate's RemoteObjectInvoker to call methods in my FluorineFX based API. However, all requests seem to be sent to the server sequentiality. That is, if I dispatch a group of messages at the same time, the 2nd one isn't sent until the first returns. Is there anyway to change this behavior?

View 1 Replies

Actionscript 3 :: Capture And Alter All Outgoing Requests From A Flex Application?

Feb 22, 2012

Currently in my flex application, I've got all of the app's assets being served from my local server, but I want to be able to serve all of the assets from a CDN (URL...)

the application has quite a bit of components so rather than going to each component and changing the source of the asset, is there a way to capture all of the outgoing request from my flex application and run some logic where I can change the request from [URL]...

View 1 Replies

Python :: Flash - Handle Faults/exception In Flex In Http Requests?

Mar 15, 2012

Here is an issue i'm struggling to solve for quit some time now.I have a python + GAE backend with a flex client that communicates via JSON. I'm using flex's HttpService bound to a Responder with result and fault callbacks. When python raises an exception, I don't seem to get it in flex. I did some research and found out that the problem probably lies in the fact that the flash runtime cannot handle http responses with status code other than 200.

View 1 Replies

Flex :: Gzip - Flex - HTTPService And Gzipped Responses?

Jul 5, 2010

I have a Flex client making RESTful calls to a webservice using HTTPService. The server is returning JSON responses, which we would like to compress. Can Flex using HTTPService handle gzip-encoded responses? If so, what steps are required to make it work (e.g., which headers to set, how to decompress, etc.)? If not, can you suggest a simple alternative?

View 1 Replies

Flex :: Re-using HTTPService Object

Oct 22, 2009

I'm trying to reuse the HTTPService object in a flex app but I'm running into a problem. In the handler for ResultEvent.RESULT I'm removing the listener, but it isn't removed. I've have to catch the asyncToken from send() and attach a new property so I know what it's supposed to do in the handler.URL...You can right-click and view source.Has anyone else run into an issue where listeners aren't removed? Should HTTPService not be reused?

View 3 Replies

Flex :: HTTPService Progressbar?

Nov 10, 2009

How can I set a progress bar that may start when an HTTPService is sent and stop when the HTTPService ends?I followed code given here but encountered following error Type was not found or was not acompile-time constant: ProgressWin.Don't know whether ProgressWin.mxml is a component or module or what. I just created a new ProgressWin.mxml file and pasted the code you posted but following error popped out before

View 1 Replies

Flex :: XML HTTPService Result And For Each

Mar 3, 2010

XML is cool in flex, but I have an annoying problem to solve, caused by what I can imagine is a feature. You see, when you have just one tag of something, it creates an object which is not an array. But when finds more than one, it puts it on an array structure.[code]I could check the format of resObj.specifictag (to check if it is has an array) and then duplicate the code (for each case). But -even if it's calling a function- I don't think it is an elegant solution.Well, I hope someone has a good idea on this matter. (I know from experience that SO has much more C++ experts than flex, but well...)The perfect thing would be that HTTPrequest handled every tag in a consistent way (using always arrays... though I'm guessing that that would also have its drawbacks).

View 3 Replies

Flex :: Air - HTTPService Times Out Anyway?

Jan 11, 2012

I'm getting an error after 30 seconds of execution of this service

<s:HTTPService id="svcList" url="http://localhost/index.php" method="GET" result="svcList_resultHandler(event)" fault="svcList_faultHandler(event)" requestTimeout="300">
<s:request xmlns="">
<mod>module</mod>

[Code]...

View 2 Replies

Flex :: Two Different HTTPService Classes?

Jun 2, 2009

Why are there two different HTTPService classes in Flex?thisandthisAnd the second one inherits the first one.Why couldn't there be a single class combining the two?

View 4 Replies

HTTPService In Flex With Multiconnections

Jun 10, 2009

I am using an HTTPService in my Flex application. I want to load several xml files, each about 1mb in size. Sometimes I need to stop loading previous xml file and start loading a new one. If I use HTTPService.cancel(); or HTTPService.disconnect() , it increase the time to get the answer from the server.Is there a quick way to stop the previous loading in HTTPService and start new one?

View 1 Replies

Flex :: OnResult HTTPService?

Aug 28, 2004

I have a HTTPService:

<mx:HTTPService id="scoreService" url="http://" method="POST" result="onResult(event)">
<s:request xmlns="">
<name>{..}</name>

[code].....

View 3 Replies

ActionScript 3.0 :: Dynamic URL In Httpservice (flex 3/AIR)?

Mar 2, 2010

I am trying to create an desktop app where the user selects an XML doc via a FileSystemTree. Then at the click of a button, that xml doc selected will be loaded in as the XML doc of choice. So far I have it working only if i hardcode in the path, but i need to make it so that the user can select the file dynamically.

Code:

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"

[code]......

View 4 Replies

Flex :: Populating ArrayCollection With HTTPService?

Jul 14, 2009

I am creating a RSS Feed application based on a data, and I have the following:

I have an ArrayCollection that is pre-populated with data. I am sorting through the ArrayCollection, get 1 piece of data (condition), and need to connect to an RSS feed which returns me the title, and I set my ArrayCollection in correspondence to condition -> title.

public function updateArrayList(list:ArrayCollection):ArrayCollection {
trace(list);
for(var i:int = 0; i < list.length; i++) {
//Alert.show(list.getItemAt(i).condition);

[Code]....

View 1 Replies

Flex :: Flex3 - ConcurrencyError Using HTTPService

Aug 21, 2009

I'm getting occasional ConcurrencyError faults when using HTTPService in Flex 3. I have four HTTPService objects, all configured with concurrency=single. I'm not sure though how to continue to diagnose, as I don't see in the FaultEvent what service object caused the issue, and I can't easily reproduce it on-demand.

One feature of my app is that I am also using a URLRequest to load a sound shortly after receiving a result from one of the HTTPService calls. Could this be related to the concurrency error?

The fault looks like this:

[FaultEvent fault=[RPC Fault faultString="Attempt to invoke while another call is pending. Either change concurrency options or avoid multiple calls." faultCode="ConcurrencyError" faultDetail="null"] messageId=null type="fault" bubbles=false cancelable=true eventPhase=2]

View 1 Replies

Flex :: Populate ArrayCollection With HTTPService?

Nov 11, 2009

I want to load data from a external XML file, using a HTTPService, and on the ResultEvent of the same HTTPService i want him to populate a ArrayCollection with the data from the XML.

I think a ArrayCollection is the ideal for this XML.

XML

<?xml version="1.0" encoding="utf-8"?>
<PhotoGalleryData>
<Photo>

[Code].....

View 2 Replies

Httpservice - Authenticate To Freshbooks API Using Flex?

Nov 23, 2009

I am new to Flex (FLex Builder 3.0), and I'm creating a simple application that would basically just authenticate to the Freshbooks API (www.freshbooks.com) via HTTPS. without sending anything else.

[Code]...

How do I code it such that the username (the authentication token given by freshbooks) would be sent to the server from within Flex itself and not the browser? My expected outcome is that there would be no pop-ups from the browser and whatever the freshbooks server returned would be displayed in the text area (txtArea1).

Note: If I input the authentication token to the browser pop-up, the application is able to correctly display the output to the text area.

View 2 Replies

Flex :: Dynamic Datagrid Httpservice?

Jan 4, 2010

I receive from the httpservice with a certain frequency a string like this:1#3#234525234whererow#column#valueI want to display into datagrid the above string at real time; at the moment my code displays the whole string, composed by many strings like the one above.How can i solve the problem?I have the following code

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
xmlns="*" creationComplete="srv.send()" >

[code]....

View 1 Replies

Flex :: Refreshing An XML File Through HTTPService?

Apr 21, 2010

I'm having a problem refreshing an xml file. I am bringing it in through an HTTP service component and putting it into a bindable array _cattArr, that I am using as the dataprovider for a grid.When someone adds an item to the datagrid, it saves to the same xml file. Then I close the window, reopen it and don't see the item that has been added.It is writing to the xml file, because when I restart the flex app, the item has been added, it's just not refreshing it. I have tried to resend the httpservice, but still no luck. What is the correct process for doing this?

View 3 Replies

Flex :: Can't Read Output Of Httpservice

May 8, 2010

I have an HTTPservice[code]...

I plan to add other variables to the output time, so need to access each time and worked separately. I may also need to return multiple responses each with their own worked and time values. How do I do that. I was thinking to not use XML. Is there a more lightweight option. Flex shows I have the following options: array e4x flashvars object text xml

View 2 Replies

Flex :: HTTPService ResultFormat, How To Choose?

May 10, 2010

HTTPService has a property resultFormat which can be set to any of the following: array e4x flashvars object text xml .I looked at the documentation to understand the difference, but still couldn't understand when to use each. I'm looking for the lightest weight of all of them.

P.S. I'm consuming output from my own server, so can change the output format as needed to make it compatible with each.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved