(This tag must be placed inside an <EventHandlers> tag or a <MessageHandlers> tag)

The RemoteObjectInvoker tag is used to create a Remote Object instance and call a method on the object created. To use this tag, you need to specify the same attributes you would when creating a remote object with the <mx:RemoteObject> tag. In addition, you need to specify what method to call. This tag will also accept all mx.rpc.remoting.RemoteObject tag attributes (with the exception of the "operations" property).

<RemoteObjectInvoker destination="YourDestination" source="" method="methodToCall" arguments="{['argument1', 'argument2']}" />

The above example would be the same as doing the following:

<mx:RemoteObject id="myService" destination="ColdFusion" source="" />
myService.methodToCall('argument1', 'argument2');

You would also need to either create event handlers for the server result and fault or create a Responder to handle them. That is not necessary when using the RemoteObjectInvoker tag because results and faults are handled by Mate. See section "Handling a service result or fault".

With this tag, you can also utilize an already created RemoteObject instance. This is useful when the same services are used by several EventHandlers blocks or several EventMaps.

Suppose you have a Remote Object tag (either in the event map itself or in a different file):

<mx:RemoteObject id="myService" destination="ColdFusion" source="" />

You can call a method on that already created service as follows:

<RemoteObjectInvoker instance="{myService}" 
	arguments="{['argument1', 'argument2']}" />

See the best practices for this tag




The method attribute specifies what function to call on the remote object instance.


If the remote method has arguments, you can pass them via the "arguments" attribute.

Suppose you have a RemoteObject method called getPhotos and it expects a user name and an album name as arguments. You can specify them with the arguments attribute:

	destination="YourDestination" source=""
	arguments="{['Tom','My Album']}" />

Note that the arguments attribute expects an array. Besides passing literal values, you can pass values coming from the event that triggered the list execution:

	destination="YourDestination" source=""
	arguments="{[event.userName, event.album]}"/>

This assumes that the event contained a userName property and an album property.

You can also pass the complete data or lastReturn as an argument depending on what your service expects.

	destination="YourDestination" source=""
	destination="YourDestination" source=""

Of course you can use any combination of arguments:

	destination="YourDestination" source=""
	arguments="{[event.age, lastReturn, 'Tom']}"/>


A RemoteObject instance

The instance attribute specifies the already created service instance to use to make the call. This attribute must be supplied using bindings because it needs to point to an already created object.

Suppose you have a RemoteObject already created:

<mx:RemoteObject id="myService" destination="ColdFusion" source="" />

You can make a call to this service by using the RemoteObjectInvoker tag, with instance {myService}. Note that any property you need for your service must be defined in the RemoteObject tag.

<RemoteObjectInvoker instance="{myService}" />



Whether to show debugging information for this RemoteObject resultHandlers and faultHandlers. If true, Console output will show debugging information as those handlers run.

Inner tags


A set of handlers to run when the server call returns a result. Inside this inner tag, you can use the same tags you would in the main body of an <EventHandlers> block, including other service calls.


A set of handlers to run when the server call returns a fault. Inside this inner tag, you can use the same tags you would in the main body of an <EventHandlers>, including other service calls.

Handling a service result or fault

You can have a resultHandlers block and a faultHandlers block inside the tag to handle service results and faults.

<RemoteObjectInvoker destination="YourDestination" 
	arguments="{['argument1', 'argument2']}">

		... this list executes when server returns results ...
		... this list executes when server returns an error ...


See "Handling a service result or fault" for more information.

37 responses

  1. Hi,

    I'm experimenting with converting a Cairngorm application over to Mate, not having much luck since I'm also very new to Cairngorm. However, i've hit a snag with SetCredentials()

    Is SetCredentials() supported by MATE on remote object calls? If it is, can you point me in the right direction please.

    Many thanks,

    Matt Law
  2. Whoops, here it is:
  3. So there's no discussion about the source attribute. Is it required? If so what exactly is this? Does it have to subclass a certain class?

  4. Charlie,
    All the attributes not discussed here correspond to the RemoteObject tag ( ), including source and destination. Whether it is required or not depends on what adapter you are using on the server.
  5. Is there any way to pass in named arguments? i.e. firstName='Tom'
  6. Jim,
    Usually, the Flash Remoting Gateway will take an object as named arguments when it is the only thing you sent (it may vary by AMF implementation I guess). If you are passing literal values, then it is as simple as:
       arguments="{{firstName: 'Tom', lastName: 'Smith'}}"/>

    If you need data from somewhere else, then you can construct the object before sending it:

    <ObjectBuilder generator="{Object}" cache="false">
    <Properties firstName="{}" lastName="{event.lastName}" />

  7. Have to say, I've been dipping in and out of this for weeks now, and its suprisingly easy to remember and get back in to.

    With those changes you did for me, I've now got it working with .NET authentication, and the Cafe Townsend example was the perfect basis for me to built my try-out my new application.

    All in all, great stuff!! :)

    Many thanks.
  8. How can I concatenate an event property ie. to the source attribute?
    I want to do:
    source = "{}.cfc"

  9. Rob,
    You'll have to create the path elsewhere (ie: using MethodInvoker) and then use the properties tag inside the RemoteObjectInvoker:
    <Properties source="{lastReturn}" />

    Having said that, I am not 100% sure you can dynamically change the source. I'll have to verify it.
  10. For the sake of portability across different servers i choose not to user services-config.xml file, usually creating a custom channel using parameters from flashVars:

    var ch:ChannelSet = new ChannelSet();
    ch..addChannel(new AMFChannel('amfphp', parameters.gatewayUrl));

    then use it in the service, i've glazed upon mate source code and found channelSet property in ServiceInvoker, i guess this would be the place to change it with above.

    Now, what would be the "Mate" way of doing this ?
  11. ion,
    You can do that or set each attribute you need to be dynamic with the Properties inner tag:
    <RemoteObjectInvoker ...>
    <Properties endpoint="{YOUR DYNAMIC GATEWAY URL}" />

    The drawback is that you have to do it in every RemoteObjectInvoker. A better way would be to change that in the RemoteObject instance, either changing the channel set or the specific properties. You could do that in many different ways: binding those values to some static variable in a class, which you would change on FlexEvent.INITIALIZE or pass the remoteobject instance to some class that sets the properties, etc.
    <mx:RemoteObject endpoint="{Config.endpoint}" .../>
  12. Laura, Thanks for this previous answer - I am not at a level where I can really follow these tips. I am working on finding the best solution to use pyAMF with Google App Engine in combination with Mate. The pyAMF site shows how to manually configure a remote object (because pyAMF does not support service-config.xml or remoting-config.xml) but I am not seeing how to combine this with Mate's remote object features. Here is the pyAMF link: Any information you could provide or sources for further reading would be greatly appreciated.
  13. Hi Greg,
    I am pretty sure that you can still use the RemoteObject tag, even if you can't use services-config.xml. I think the example they show would translate to:
    <mx:RemoteObject id="service" endpoint="http://localhost:8080/services"; destination="EchoService" />

    <EventHandlers ...>
       <RemoteObjectInvoker instance="{service}" method="echo" arguments="{['Hello World']}">

    If that doesn't work, then you can always add the channel set to the remoteObject tag (though I don't think the ChannelSet adds any information you don't already have).
  14. Can you pass an object from the event as the argument? So for example, if i had an object in my event called MyObject and an object in my view called formObject, and before I dispatch my event i set event.MyObject = formObject can i use that in my event map for the event RemoteObjectInvoker arguments as arguments="{event.MyObject}"? It works if I do {event.MyObject.requestID} but if i leave out the property it does not pass anything.
  15. Kyle,
    As most of the examples show, what you are trying to do should work. Please double check if indeed you are not received anything (turn debugging on and check in the console).
  16. Hi Laura,
    In debugging I can see the object looks like it was passed:
    arguments="[object SearchCriteriaVO]"
    However Coldfusion says the required argument was not passed in. Whats really strange is that if I change my argument from event.searchCriteria to event.searchCriteria.request my debugging says:
    and Coldfusion recieves the data. It seems like there is some property I am not using that I should be, any ideas?
  17. Kyle,
    Whenever you pass a single argument to a CF service (and that argument is not an aliased object), then you'll receive all the properties of the object as single parameters. That is the default behavior of the Flex remoting gateway. Since none of the names of your properties match the name of the required argument, you get the error. I see that you are trying to pass a SearchCriteriaVO. Probably the aliasing is not working correctly (make sure you have a SearchCriteriaVO in the server and that their aliases match.

    PS: For this type of problems, I recommend you to head to the forums.
  18. Can you leave the arguments attribute off of the remote Object invoker tag and it still work?
  19. Lavon,
    Yes, if you don't specify any arguments, then the service call will not send any parameters, but the call will be made regardless.
  20. Hi,
    Actually I wanted to post this in the forum, but I just cannot get in. So I try here.

    I am looking at options to authenticate through Mate to a backend. I have created a method, but now I feel I want to use a more ChannelSet oriented way. It would be great if I could do something like this:

    &lt;ChannelSetInvoker username="event.username" password="event.password" method="login">
    &lt;MethodInvoker generator="{AuthenticationManager}" method="storeAuthenticationDetails"
    &lt;EventAnnouncer generator="{AuthenticationEvent}" type="{AuthenticationEvent.AUTHENTICATED}"/>
    &lt;MethodInvoker generator="{AuthenticationManager}" method="storeAuthenticationProblem"

    I have written some functions that can actually do just this, but now I want to use the normal event handlers from Mate. What do you think? Would that be handy? I was working on a patch, but I cannot get it to work without flex builder. Tried with the flex-maven plugin, but something seems to go wrong. You have my email if you want more info.

    thanks Jettro
  21. Sorry about the previous xml, this might be better
    <ChannelSetInvoker username="event.username" password="event.password" method="login">
    <MethodInvoker generator="{AuthenticationManager}" method="storeAuthenticationDetails"
    <EventAnnouncer generator="{AuthenticationEvent}" type="{AuthenticationEvent.AUTHENTICATED}"/>
    <MethodInvoker generator="{AuthenticationManager}" method="storeAuthenticationProblem"
  22. Having trouble finding an example of the RemoteInvoker endPoint. I'm evaluating Mate for adoption by my team and I can't seem to make a amfphp connection. I've tried several variation without luck. My call is being made from an air project.
    Also can you tell me what I need to do to use the flex debugger. I have enabled Mate's debugging, but all it does is trace the call and response. So basicly it's telling me I have a fault which I'm announcing, but it's not firing the responder in the view. So I have no idea what the fault is. Can I set break points in the remoteObjectInvoker chain? I must be missing something.


  23. John,
    The best you can do is to try to connect to your remote object using plain RemoteObject tag and handle the result and faults. Once you have that working and figure out the problem, start using Mate and its RemoteObjectInvoker tag. Also see his tutorials and videos:
  24. Laura,
    Thanks for you quick response. I have viewed the Hello world screencast. It requests that I use a services xml file. I want to skip that step and use the endpoint instead, but I'm not having luck finding a real example of that working. I'm having as much trouble finding a mxml remoteobject tag example. I can implement and connect with a channell in AS, but no luck with mxml. Can you point me in the direction of a working example of either your RemoteObjectInvoker or the mx remoteObject with endpoint used in it?

  25. Hi people,

    I have one question about Mate. I work with java, but i dont know how to use the RemoteObject using Mate with Java. I need to use the remote-config.xml file to mapping my "services" classes on Java? I have some thing like that without mate:

    in my login.mxml file have:

    <mx:Script source="" /> ( below)

    <mx:RemoteObject id="loginService" destination="LoginService" showBusyCursor="true">
          <mx:method name="login" result="onLoginHandler(event)" fault="onFaultHandler(event)"/>

    and when i want to use the method "login", i do: File)

    private function btnEntrar():void
    this.loginService.login(this.usuarioInput.text, this.senhaInput.text);

    and, in my remote-object.xml file have:

    <destination id="LoginService">

    how can i do this using Mate? someone have examples projects Java with Mate?

    Sorry my english, but i'm Brazilian and i don't speaks english very well!

    thanks for all!
  26. marcelocaser,
    Use the remote object that works for you and say <RemoteObjectInvoker instance="{loginService}">
    But don't put the remote object in the login view, put it in the map or in a separate file (preferred).
  27. laura, thank you for reply...

    so, i understand you, but now i have use some thing like that:


    <mx:Object ...>

    <mx:RemoteObject id="loginService" destination="LoginService"/>

    my LoginMap.xml

    <--instance RemoteObject-->
    <services:LoginService id="servicos" />

    <mate:RemoteObjectInvoker instance="{servicos.loginService}" method="login"> my faulfHandler and resultHandler right?


    is correct? after this i have to declared my destination LoginService in remote-config.xml right?
  28. Does remoteObjectInvoker hijack convertParametersHandler at all? Seems like whenever I set convertParametersHandler on my RemoteObject instance, the convertParametersHandler receives an empty array, instead of an array containing the arguments from my remoteObjectInvoker tag.

    Has anyone successfully used remoteObjectInvoker on a remoteObject instance that has a convertParametersHandler?

    Also, it would be great if I could use a RemoteObject instance from the eventMap cache, why is that not supported?
  29. Hi,
    any examp[le how the RemoteObjectInvoker would look like using Flex4 Generated PHP Services?
    Its not working like this:
    <RemoteObjectInvoker destination="PHP" source="stockquotesService"
                <MethodInvoker generator="{QuoteManager}"
  30. anyone reading this post here at all?
  31. is it possible to have a dynamic value for the source attribute? im trying to avoid hard-coding any paths into this field.
  32. What's the best way to incorporate Flex/client side logging into these RemoteObjectInvoker calls?
  33. Most Common Drug Reactions - valium medication The weights of these infants were normal by 10 months but their head circumferences still remained less than the average at 18 months. - cheap valium
  34. I use remoteobject invoker to pass string which contain a tokenSamL processed by the server side of the application.
    The token is coming from the request (by flashvar into flex) then passed to remote object invoker as an argument.At the java side of the app, the token arrived urldecoded is there a wat to pass a string and have mate not to url decode it?
  35. While using RemoteObjectInvoker, does Mate interpret "mymethod" and "myMethod" as same? case-insensitive?
  36. <a href= >selena gomez concert t shirts</a>
  37. It might <a href= >wellbutrin recall</a> be fighting. Weall know howvulnerable i wanted.Lee unbuckled his friends, stretching away from the instant <a href= >warfarin diet</a> that.

Comments now closed