3.1. HTTP Service Proxy

Rich Flash platform applications built using Flex are deployed as swf format files on a web server. When a client accesses such an application, the swf is downloaded to the client's local Flash Player instance. These swf format files are compiled binary files that can use local components to invoke remote URL(s) using the HTTP method. If the domains that these remote URL(s) point to define appropriate security policy, then the Flex application can make these calls without any trouble. If the security policy is not defined, then these HTTP calls can be routed through a server-side proxy.

BlazeDS defines such a server-side proxy for easy and flexible routing. The Apache HttpClient is actually baked right into BlazeDS. So, when you route an HTTP call through the proxy, the call is actually invoked and completed by an HttpClient instance at the server, and the response is relayed back to the Flex application.

Apache HttpClient

Apache HttpClient is a full-featured standards-complaint Java-based HTTP client that allows invocation of URI(s) using the HTTP methods. It's a user agent and so can be used to make calls in a manner similar to what a web browser does. Its latest release version is 3.x. It's available under the Apache open source license. More information about the HttpClient can be obtained from the Apache HttpComponents site at http://hc.apache.org/httpcomponents-client/index.html.

When using a server-side proxy, BlazeDS needs appropriate configuration, ...

Get Professional BlazeDS: Creating Rich Internet Applications with Flex® and Java® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.