Example name: Echoing an ActionScript object between Flex and .NET
Description: The example demonstrates the following:
  • Usage of RemoteObject to exchange complex type data between Flex client and a .NET object
  • Invocation of a remote method in a C# class with a complex type argument
  • Response and error handling
Client-side code: Browse  Download
Server-side code: Browse  Download
Product edition availability:
  • WebORB Standard Edition (localhost clients only)
  • WebORB Professional Edition
  • WebORB Enterprise Edition
Run example:
Key points:
  • The example uses RemoteObject API to declare a reference to a remote .NET class
  • The button click handler creates a generic ('untyped') ActionScript object and populates it with data from the 'Client-side' box controls.
     
    var myIdentity:Object = new Object();
    myIdentity.name = nameFieldClient.text;
    myIdentity.age = ageClient.value;
    myIdentity.sex = genderGroup.selectedValue;
    myIdentity.eyeColor = eyeColorClient.selectedItem;

  • The example sends the ActionScript object to the server. WebORB adapts the data structure received from the client to the formal argument type of the invoked method
  • .NET class makes a change in the received object and returns the same instance back to the client. On the client-side the object received in the 'gotNewIdentity' handler is not the same instance sent in the request.
Things to try:
  • Explore example's source code (click Browse or right-mouse click and select View Source)