Setting up multiple channel types (AMF/AMFX) for Flex/BlazeDs

Posted by Fergal on Stack Overflow See other posts from Stack Overflow or by Fergal
Published on 2010-03-16T08:00:42Z Indexed on 2010/03/16 8:06 UTC
Read the original article Hit count: 508

Filed under:
|
|

We've configured our Flex client to have two channels for calling our services via BlazeDS.

One channel is configured to use AMFChannel and the other for HTTPChannel. Here's the services-config.xml

          <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
                <endpoint url="http://{server.name}:{server.port}/{context.root}/data/messagebroker/amf"
        class="flex.messaging.endpoints.AMFEndpoint" />
            <properties>
               <polling-enabled>false</polling-enabled>
            </properties>
         </channel-definition>
         <channel-definition id="my-amfx" class="mx.messaging.channels.HTTPChannel">
            <endpoint url="http://{server.name}:{server.port}/{context.root}/data/messagebroker/amfx"
        class="flex.messaging.endpoints.HTTPEndpoint" />
            <properties>
               <polling-enabled>false</polling-enabled>
            </properties>
         </channel-definition>

Our flex client is written to use either AMF or AMFX depending on how we configure it. The problem is that although the client can switch between channels it sends an AMF binary payload when attempting to call services via AMFX (expecting XML). The funny thing is that we can write services-config.xml to use either AMF or AMFX individually but Flex doesn't seem to want to let us use both. Is this a bug in Flex? If not how can we get it to use the correct protocol?

© Stack Overflow or respective owner

Related posts about flex

Related posts about java