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


Similar Posts:


Java :: Flex - BlazeDS Not Handling Inner Class DTO?

Aug 19, 2011

I've noticed BlazeDS has certain things it does not support and it is often difficult to find this out. Ex: polymorphism is not.One must create methods with different names as methods with the same name with different parameters create a conflict.I'm trying to find out if BlazeDS does not support Java static and non-static inner classes.

public class UserDTO {
private String name;
private AddressDTO adddress;
private PhoneDTO phone;

[code]...

The example code above will compile and the getUser method will work. A call to the updateUser or updatePhone methods on the other hand results in a BlazeDS error. Is there a special way to use inner classes in Flex or are inner classes not supported?

Here is an example of the error messages produced:

[BlazeDS]Cannot create class of type 'com.test.dto.UserDTO.PhoneDTO'.
flex.messaging.MessageException: Cannot create class of type 'com.test.dto.UserDTO.PhoneDTO'. Type 'com.test.dto.UserDTO.PhoneDTO' not found.

Example Flex code:

var thisPhone:PhoneDTO = new PhoneDTO();
thisPhone.phoneNumber = "8885551212";
updateTagsResult.token = userService.updatePhone(thisPhone);

View 2 Replies

Flex - Session Handling - Flex BlazeDS Java?

Apr 16, 2011

Am facing issue with session timeout. Say for instance, the user logs into the application and he waits for 30 mins (session timeout time) and then tries to get a service through remote object.Ideally speaking, since the session has timeout the user shouldn't be able to hit the remote object, but this is happening the other way round.

[Code]...

View 1 Replies

Flex 4 - Using RemoteObject And Multiple Components?

Aug 24, 2010

I was wondering what is considered to be a best practice when I have multiple components and use RemoteObject for AMF communication with a PHP backend.

Have the RemoteObject in the Main.mxml file with all the methods declared here (with handlers and all) and have all components call functions from the parentApplication, thus having a centralized result and fault handling, but making reusiability more difficult.Have a RemoteObject in each component with only the methods (and handlers) relevant to that component, thus making it easy to have clean, reusable components.

View 1 Replies

Java :: RemoteObject In BlazeDS Environment: Serializing Objects From JAXB / XJC-generated Classes

May 10, 2011

I'm developing a webapp with Java backend and Flash (pure ActionScript) frontend using BlazeDS. I'm using the RemoteObject stuff to send objects, using custom serialization, where I need to implement Externalizable (Java) and IExternalizable (AS) interfaces. This works fine so far.

But now I need to send objects from Java to Flash, whose classes are generated with JAXB/XJC. Of course these generated Java classes don't implement the Externalizable interface, so it seems that I can't use my approach here. One possibility seems to be writing a XJC plugin which makes the classes implement Externalizable. But this looks like a tough job...

View 2 Replies

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

Flex :: Oracle - Remoteobject Multiple Records In Database Of Same Info?

Feb 11, 2012

Case1: When a client makes a remoteObject request ie to save some Info... A call is made to Java SAVE_INFO method. If request failed ie came back to FaultHandler ( we save the info in an arrayCollection).Later we call SAVE_INFO again for each item in arrayCollection ie( if arrayCollection has 10 items.. We call 10 times the same method.. I know that's kind of stupid but we have no control over java to write a overloading method). Some times we see there are multiple records of same info in DB. I am not sure if this happens when looping over arraycollection and making calls or during normal one time call. We could not find a pattern to reproduce. Java LOG level is at Error level in production. can't set to INFO in production to monitor all calls. We dont know if this multiple times saved record is, the one in arrayCollection or normal one.

Flex3 RemoteObject --> WAS 6.1 , lCDS 3.0, Java1.5 --> Webservice -- > Java (hibernate) --> Oracle 10gCase2: When application is left open and user leaves for the day and submits info the following morning, we see duplicate records in DB of that info.(No arrayCollection here. Simple straight one call)Flex3 RemoteObject --> OC4J Blazeds Java1.5 (JDBC) --> Oracle 10g.Recently one of our Testers testing case 2 application found this pattern and I am starting to think that may be in the case 1 also.. users might be leaving for lunch/break and resubmitted the arrayCollection after coming back. During lunch java might have killed the sessions for the client and after resubmitting 10 at same time.

View 1 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

Flex :: Handling Multiple Views Of The Same ArrayCollection

Feb 22, 2010

I have an ArrayCollection bound to a view, I use a filterFunction on this view to only display parts of the contents. Additionally I have another component where I want to display other parts of the ArrayCollection.

What I would like to do is wrap ArrayCollections around each other, meaning I could have one ArrayCollection containing the model data, and then two separate outer ones where I can set the filterFunction property (setting this in the model seems inappropriate in all cases). Is this possible somehow? If not, how else can this be solved, preferably without forcing model logic to end up in my view?

View 2 Replies

Flex :: Handling Multiple Artifacts From Single Maven Project

Oct 12, 2010

I have a maven project that produces many artifacts. Of course it is kind of against maven best practice (one pom one artifact), but it is Adobe Flex project that produces many *swf modules and it is really makes no sence to create a separate project for each module.

For me it would be very convinient to handle all swf modules as a single zip archive eg. zip archive would be my artifact.

So I am looking for the way to pack and unpack my zip artifact with maven.

View 1 Replies

Flex :: Handling Multiple UIComponent With Single Skin Class

Aug 4, 2011

I have created a simple mxml file with code as follows:
<s:application..........>
<s:BorderContainer>
<s:SkinnableContainer id="firstRow"/>
<s:SkinnableContainer id="secondRow"/>
<s:SkinnableContainer id="thirdRow"/>
</s:BorderContainer>
</s:application>

Now I want to apply different font size, font color and font type and background color on each row i.e each of the three skinnableContainers.Currently I have defined 3 different skin classes for each of row but I think this is a bad programing. I should create a single skin class for outermost container i.e BorderContainer and any how provide different fonts and background color to all the 3 child containers through that skin class. So, is it possible that I can create single skin class that can provide different decorations to each of the child container.

View 1 Replies

Flex :: Mx:method, Mx.rpc.remoting.mxml.RemoteObject, And Sub-classing Mx.rpc.remoting.mxml.RemoteObject?

May 6, 2010

I am looking to subclass RemoteObject. Instead of:

<mx:RemoteObject ... >
<mx:method ... />
<mx:method ... />

[code].....

View 1 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 :: Output Database Information In A Text Input Field In Flex By Using RemoteObject(cfc)

Mar 16, 2011

im trying to output my database information in a text input field in flex by using remoteObject(cfc). The information is being provided by a database using a query and an array collection. I'm just unsure how i go about taking the queried array collection information and display it into TextInput Fields.

[Code]...

View 1 Replies

Flex :: Why Wouldn't A Flex Remoteobject Be Able To Work Within A Custom Component

Mar 31, 2010

I have a remoteobject within my main.mxml.I can call a function on the service from an init() function on my main.mxml, and my java debugger triggers a breakpoint.When I move the remoteobject declaration and function call into a custom component (that is declared within main.mxml), the remote function on java-side no longer gets called, no breakpoints triggered, no errors, silence.[code]

View 2 Replies

ActionScript 3.0 :: Multiple Request Handling?

Aug 22, 2009

I have a bit of code listens for a user to click a navigation item, however if they click another nav item then my code loads both of them and puts the content pages on top of each other.I am having loads of problems with this bit of code.

PHP Code:
private function _menuSelectHandler (event : MenuEvent):void {
if (! event.abstract) {

[code].......

View 7 Replies

Event Handling On Multiple Instances Of One Mc

May 17, 2010

I have a problem with event handling. I'm working on a calendar, on which events can be listed. With actionscript i loop through an XML file with the days (and if there, the events for that day). So far so good. Where it goes wrong is this: I only want to display blocks with the day numbers on it. When you click on a day, a box pops up and shows the event's for that day.

This is what i did: created a movieclip with classname mc. loop trough the xml file and for each day create a new instance of mc with the day number as text on it. This al works, but now i want to add an eventhandler for each day. How to do this?

View 1 Replies

Flex :: RemoteObject Synchronous Call?

Oct 1, 2009

In the code below when I call chkAuthentication function from another function the remoteObj.login (login function in my service file (.php)) is called after the remaining code in that function. i.e., the loginStatus is returned from the function before the result-handler function loginResult is called. but my loginStatus is supposed to be set in loginResult function. It seems that the asynchronous behaviour is the culprit. what should I do in order to get the loginResult function to complete first?

[Code]...

View 2 Replies

Actionscript :: Flex RemoteObject Timeouts?

Oct 21, 2009

I've been tinkering around with Flex RemoteObjects, and I've found that they aren't very well behaved with respect to timing out.First, I can't figure out how to set a timeout on "connect". I know I can set requstTimeout, which will correctly timeout after an initial handshake... But if the server doesn't handshake, the connection doesn't time out (eg, the server accepts the connection, then does nothing with it, the client will just be left hanging).

Second, when a requestTimeout fires (timing out the request), Flex doesn't actually take any steps to tear down the connection - it just leaves it hanging there (no RST or the like). Clearly, this is more than a little bit undesirable. Is there any way to explicitly tear down the connection after the timeout?

View 1 Replies

Flex :: Possible To Abort RemoteObject Call?

Apr 7, 2011

Is it possible to abort a flex remoteObject call? I tried the below method but the http request is still loading in the background:[code]The thing I'm interested in is freeing up the browsers HTTP Pipeline, just like in javascript where you can use abort on the XHR.

View 2 Replies

Flex :: Get The Result Of A RemoteObject Immediately?

Apr 29, 2011

I need to make a function that execute a java method and return his result. It is static becouse a lot of other functions will call this function. So I did this:

public static function FKDescription(dest:String):String{
var jRemote:RemoteObject = new RemoteObject();
var s:String;

[Code].....

But the function returns null, because the valresult() was not been called at the end of main function. What shoud I do to make FKDescription() return the string that came from remoteobject?

View 2 Replies

Flex :: Synchronous Calls Using RemoteObject?

Apr 2, 2009

Is there a way to make synchronous calls using RemoteObject in Flex?

Solution: Add the second call to the result handler of the first call, having a token check for multiple originating calls.

View 9 Replies

ActionScript :: Flex - RemoteObject Response Headers?

Jun 16, 2009

I am in the process of writing an application in Flex 3.3, using the Cairngorm framework, for deployment as an AIR application. The application heavily utilizes RemoteObject services to get data from a web server.Each of my service delegates extends a common class which provides a method for calling service methods on the RemoteObject.So, where I previously usedServiceLocator.getInstance().getRemoteObject('myService').myOperation.send();I instead usethis.send('myOperation', 'myService');I use this method instead of calling the RemoteObject operations directly because this method adds another, global, responder to the operation call. This extra responder analyses data in the headers of reponse from the server.

Or at least it should -- this is where the problem is. In the result data (event as mx.rpc.events.ResultEvent) the headers property is always null despite the headers definitely being sent from the server.

View 1 Replies

Flex :: RemoteObject Inconsistent Channel Location?

Jul 1, 2009

I have a swf which, for some reason, has four RemoteObjects pointing to the same ChannelId, but they are listing that channel as being at two different spots. In four of the five RemoteObjects, everything behaves as expected, but in the fourth (WidgetService), the version on dev is switching from dev.context.root toloc.context.root. To make matters more confusing, it only does this on the dev server (QA and production are fine, as are local builds).The relevant information from the config files follows:

#This is from build.properties, which is used by Ant
#to build the swf on the server
flex.sdk.dir = /path/to/sdk/flex_sdk_3.2.0.3958

[code].....

View 1 Replies

Flex :: Prevent RemoteObject From Batching AMF Messages Together?

Jan 10, 2010

I am using Google AppEngine, in conjunction with PyAMF to provide RemoteObject support. In my Flex code I make several RemoteObject method calls at once which tends to batch the AMF Messages into a single HTTP request. Most of the time this is fine but AppEngine applies some strict per request limits (in this case I am hitting a DeadlineExceededError - max 30 seconds). A number of service methods are expected to take upwards of 10 seconds and if these are batched by the RemoteObject into 1 HTTP you see where this is going. Now you could say refactor your service calls and that is also going on but not really the question being asked here. Is there a way to prevent Flex RemoteObject from batching AMF requests for situations like this? I have done a fair amount of Googling on the subject and come up with bupkis. It seems to me that I would need to implement a custom version of mx.messaging.channels.AMFChannel or something of that nature, which seems waay too hardcore for a feature like this

View 3 Replies

Flex :: RemoteObject Intermittently Failing To Invoke CFC

Jun 10, 2010

I have a Flex app that uses Flash Remoting and the RemoteObject to pull data from a ColdFusion CFC. About 75% of the time it works, but the other times I get a message using Charles (a debugging tool) that says faultString = "Unable to Invoke CFC". FaultCode = "Server.Processing".

Here's my RemoteObject:

<mx:RemoteObject id="carsSvc" destination="ColdFusion" source="ca.sqmIDash.cfc.sqmIdash">
<mx:method name="getCARs" result="resultHandler(event)"/>
</mx:RemoteObject>

The server set up on our web farm is to use load balancing. I'm not sure if this is causing the problem or not. Probably not, but it's a thought.

View 1 Replies

Flex :: AIR Application Connecting To RemoteObject Through Proxy?

Apr 29, 2011

I am having some issues trying to make an AIR application connect to a RemoteObject when the application is run in a domain that has proxy servers for outbound connection.The error provided is as below:

[RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: 'http://myTestService.org:8080/default/message/amf'"]

View 1 Replies

Flex :: Implement RemoteObject In A Foreign Class?

May 27, 2011

Heres the code:

[Code]....

Unfortunatly, its doesnt reach the eventHandler, when i call the loadCurrentSchem() function. Whats wrong? This is how i call the class:

[code].....

View 1 Replies

Flex 4.5 :: RemoteObject And AMFPHP Over SSL With Self-signed Certificate

Nov 2, 2011

I'm trying to connect to AMFPHP over SSL (self-signed) from a Flex 4.5 application.Will this work? Or do I need an authority-signed certificate?Will it silently fail or prompt user like it does in browser?How do I need to edit the services-config.xml file for this to work?

View 1 Replies







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