开发者

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

开发者 https://www.devze.com 2022-12-22 21:16 出处:网络
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

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.AMFEn开发者_StackOverflowdpoint" />
            <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?


This seems to be a limitation of Flex

It has been my anecdotal experience that Flex clients can use one and only one channel on a server. It's not just an AMF/XML limitation but also applies to streaming versus polling channels.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号