
136 Data Services
Flex 2 separates the definitions of services into a new file, services-config.xml. This file
contains definitions of the services and security constraints that were previously in the flex-
config.xml file. Optionally, it can include other configuration files by reference. The services-
config.xml file is located in the flex_deploy_dir/flex/WEB-INF/flex directory of a web
application in which you are using Flex Data Services. If you use the command-line compiler,
you must point to this file with the -services option.
The underlying architecture for communicating with the server for each type of service is
based on a new messaging framework in Flex 2. As a result, you use message channels to
communicate with the service. You configure channels in the services-config.xml file. The
new new messaging framework uses channels to connect clients to endpoints; requests are
made by sending messages over channels to endpoints of a message broker that directs the
messages to the correct service.
For information about the client-side configuration of RPC components, see Chapter 45,
“Using RPC Components,” in the Flex 2 Developer’s Guide. For information about the server-
side configuration of RPC service destinations, see Chapter 46, “Configuring RPC Services”
in the Flex 2 Developer’s Guide.
Proxy use policy
In Flex 1.5, there was as setting that let you override the proxy. This was the <proxy-use-
policy>
setting in the flex-config.xml file. If you set it to client, Flex checked the value of
the
useProxy attribute on the service tag. The default was to use the proxy. If you set it to
always, Flex used the proxy regardless of the value of the useProxy attribute. If you set it to
never, Flex did not use the proxy regardless of the value of the useProxy attribute.
The
<proxy-use-policy>client</proxy-use-policy> setting does not exist in Flex 2.
Flex behaves as if the value is
client, which means that Flex checks the value of the
useProxy attribute on the service tag. The default value is false. If this value is not set, Flex
does not use the proxy.
Channels
Flex now requires that you specify a channel to define the way data is transported for each
RPC service destination. Service requests and responses are now messages. Messages are sent
and received on a channel, which represents a logical connection to a destination. Channels
define a protocol and a port.
Each channel corresponds to one network transfer protocol that Flash Player supports. For
example, the AMF channel uses the AMF format over HTTP and the HTTP channel uses a
text-based format over HTTP.
Commentaires sur ces manuels