Accessing Remote Services Locally

Someone told me recently that they were fed up of uploading their Flex application swf to test its functionality. The reason they uploaded the swf to their remote server was to call the ColdFusion methods using RemoteObject. The process was similar to this:

  • make change to code > publish swf > upload swf to server > run swf in browser using remote url.

To make things quicker and easier you can actually access your remote services locally from within Flex by defining an endpoint to your RemoteObject:

1
2
3
4
5
6
7
<mx:RemoteObject id="myService"
       destination="ColdFusion"
       source="com.newtriks.flex.api"
       endpoint="http://yourwebhost.com/flex2gateway/"
       fault="onFault( event )"
       result="handleResult( event )"
       showBusyCursor="true" />

You can then run and debug your application locally without the need to upload the swf to the remote server.

Comments